Skip to end of metadata
Go to start of metadata

Abstract Pattern provides an interface for creating families of related or dependent objects without specifying their concrete classes. Inherited subclasses of the abstract super class would know which of the objects are required.

These are the Participants in this UML:

  • AbstractFactory: An interface with operations that creates abstract products
  • ConcreteFactory: Implementation of the AbstractFactory which creates actual products
  • AbstractProduct: An interface for each type of product object
  • ConcreteProduct: implementation of the AbstractProduct. This object would be created by respective concrete factory
  • Client: Creates object of the ConcreteFactory by using AbstractFactory interface

Design Time Consideration:

  1. Define an abstract superclass for the products.
  2. Inherit Subclasses from this super class as concrete products.
  3. Define an abstract superclass with abstract methods to create specific products
  4. Inherit Subclasses from this class as Concrete factories which would instantiate product objects as desired.

Follow this ABAP Objects Design Patterns – Abstract Factory for more information (NOTE: outside SDN link).