Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's a Singleton?
Message
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
01417218
Message ID:
01417328
Views:
59
Just to add a bit to help with design and implementation

Domain Driven Design has the concept of a "Repository", which basically is a collection of references to global objects, often singletons. When an object needs a singleton, it calls a method on the Repository that returns a reference to the existing global object (not I don't call it a singleton here, because it may not be one). If the global object doesn't exist, the Repository typically calls a Factory to create it. The factory returns a reference to the Repository. The Repository then adds the reference to it's collection of global objects, then returns the reference to the calling object.

I've actually been doing this for years in my VFP apps... long before I knew what it was.

>What's a Singleton? An example would be nice?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform