Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which pattern to use
Message
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01023978
Message ID:
01024012
Vues:
27
Sound like a good case for the Factory Pattern. The tricky part is returning the correct object. In this case I would consider using an interface class.

All your classes would comply to this interface so all you have to do is instantiate it. Regardless of what class you create through the factory you will be able to call its method since it complies to the contract of the interface.

Hope it helps!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform