Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's a Singleton?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01417218
Message ID:
01417328
Vues:
60
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform