Factory Method design pattern could be most used design pattern in the modern world application. Factory method design pattern hides all the complexity of the instantiating an object from the consumer. This DP provides an unique interface for object instantiation. This interface creates an object but let subclasses decide which class
Design time consideration:
- Create a Super Class with Factory method
- Create importing parameters: This would be used as conditions to define the subclass name
- Inherit the Subclasses from the Super class
- Define an object reference type to Super Class
Follow this ABAP Objects Design Patterns – Factory Method for more information (NOTE: outside SDN link).