Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 27th, 2004, 02:00 AM
Registered User
 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nagendrakumar_b
Default About(sealed in c#/MustNotInheritabl in vb) class

Hi,
I am using a (sealed in c#/MustNotInheritable in vb) class with a Private constructer, for restricting new instances, which can be used directly without declaration. In this class we have both public and private static(for C#)/shared methods, which contains local variables inside the methods. This methods used for fetching, updating the data using datasets, dataviews, command objects & parameters for calling procedures in the database. So when more than one user calls the same method declared as public shared/static, what actually happens internally?

i. Whether object implements thread safety, which automatically synchronize the calls of the multi-users.
ii. Whether the utility class takes cares only single call, without caring other calls?, means working like a single threaded component.
iii. Whether the utility class automatically create instance for the each users.
Please kindly let me know clearly what actually happens and how the threads behave


 
Old May 3rd, 2004, 02:48 AM
Registered User
 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nagendrakumar_b
Default

Hi friends,
I was post my query long back but i didn't got response to it. Now i got solution from one of my friend. But i saw people read my post. So it would nice if i share my answer with everyone. Thanks for the persons who read my previous post.

****************
actually the thing here is MustnotInheritable/sealed class with private constructors are not targetted to
implement
directly in side the application without any transaction control. It
may be
included in Business Logic Layer or SQLTransaction object. For example this type of component can be used with COM+ transactions. when we come across any situation to use this component for transactions, it is better to use in conjunction with the Transaction model of ADo.net or COM+. Regarding thread safe, by default the components created by .NET are thread safe. Even more than user calls the same method, shared method inside using local variables. It creates new memory locatios for that. So any way it doesn't create any impact on application.

thanks...

Do Reply if your problem solves. It helps everyone to find and get the right solution.

Nag





Similar Threads
Thread Thread Starter Forum Replies Last Post
different class between vb and c#(two books) yonghoo BOOK: ASP.NET Website Programming Problem-Design-Solution 8 September 1st, 2004 08:28 PM
VB.NET Class Builder Tek4VB VB.NET 0 April 5th, 2004 12:50 PM
How do I refer to a class instance in VB? James Diamond Beginning VB 6 7 February 9th, 2004 03:31 PM
How to include c# class and vb class in the .vbprj umeshayk VS.NET 2002/2003 2 January 9th, 2004 12:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.