Free since 2005 · No login required
AT

Academic Tutorials

Learn at your own pace

site-mobile-top-banner · 320x50

Abstract Factory Design Pattern Implementation in C#

Added 29 Jul 2008

The Abstract Factory design pattern defines an interface containing Factory methods which decouple the client from the concrete (actual) classes required to instantiate a family of related products. Thus, the client need know nothing about the actual concrete implementations. That is, there are no hard-coded class names in client code.bstract Factory provides an interface for creating families of related objects without specifying their concrete classes. It…
  • encapsulates object creation.
  • relies on object composition—object creation is implemented in methods exposed in the factory interface.
  • promotes loose coupling by reducing the dependency of the application on concrete classes

Abstract Factory defines an interface for creating a set of concrete products. Each Abstract Factory interface method:

  • creates a concrete product.
  • subclasses Abstract Factory.
  • is implemented as a Factory method.