Cesar,
I read that using Shared in DLL is not the best practice to use.
Correct Shared should not be your first choice, however there are times when
it is appropriate. It depends on the type of app. Like any construct
available in .NET its usage has its pros & cons.
As I said in my other email, you need to use it for the Singleton Pattern,
what you asked sounds like a good application of the Singleton Pattern,
assuming this is not an ASP.NET app. ASP.NET apps you need to use session &
context aware methods of implementing a singleton. Which is where public
shared methods (properties, subs & functions) are better than public shared
fields. You can change the code of the method to better anticipate the
environment you are running it.
The Singleton Pattern is a common OOP Design Pattern to allow global access
to an object. For details on the Singleton Patten and other Design Patterns
see:
1. "Design Patterns - Elements of Reusable Object-Oriented Software" by the
GOF (Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides)
2. "Patterns of Enterprise Application Architecture" by Martin Fowler
3. "Visual Basic Design Patterns - VB 6.0 and VB.NET" by James W. Cooper.
#3 is a good companion for #1, #2 shows some advanced patterns. All three
are from Addison Wesley.
Hope this helps
Jay