by, 03-09-2012 at 07:07 PM (575 Views)
Most widely used design pattern is the Factory design pattern in modern programming languages, for example C# and Java. It comes in many different implementations and variants. If you are seeking them you will probably find out certain references regarding GoF patterns: Abstract Factory & Factory Method.
Commonly used factory patterns are defined here and also you might check out the similar original factory method patterns.
- Without exposure of the instantiation logic, objects are created.
- Newly created objects are referred via one single common interface.
Implementation is really a very simple task.
- Clients require a new product therefore it would be asking the factory object for that particular new product instead of making it by using new operator.
- New concrete products are being instantiated by the factory and then is returned to client the new product
- Products are used by the client as abstract product without knowing regarding the concrete implementation.