Factory Method Pattern In C#


Definition Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.   Frequency of use: High     UML class diagram       Participants   The classes and objects participating in this pattern are: Product  (Page) defines the interface of objects … Continue reading Factory Method Pattern In C#

Abstract Factory Pattern In C#


Definition Provide an interface for creating families of related or dependent objects without specifying their concrete classes. Frequency of use: High UML class diagram Participants The classes and objects participating in this pattern are: AbstractFactory  (ContinentFactory) declares an interface for operations that create abstract products ConcreteFactory   (AfricaFactory, AmericaFactory) implements the operations to create concrete product objects … Continue reading Abstract Factory Pattern In C#