We are using general DAL class for all common DB routines. That class has many shared member functions which can be called without instantiating the class. My questions, in a multiuser environment, as there is no instantiation involved for this class, how the function calls are processed? Will there be any performance issue? I have seen many MSDN code examples uses public shared function for common routines and so wondering whether it is right way for multiuser environment.
thanks in advance
Sriram
The difference between a static and instance methods is that instance
methods take an extra argument (this, or in VB "me"). So if you did a
static member that took an instance of its type as arg0, you'd have
something very similar to an instance method. The design issues (being able
to override methods) is much more important.
You do need to make sure that your static methods are threadsafe. For
instance, you shouldn't have a static method that changes a static variable
(for instance, in a DAL, storing the command in a static variable would be
bad), unless you use lock (SyncLock in VB). Using a lock to syncronize your
threads could create a performance problem. However, so long you stick to
locals and arguments, you're fine.
-mike
MVP
"Sriram" <anon...@discussions.microsoft.com> wrote in message
news:F8A1DE67-117C-475D...@microsoft.com...