by, 03-09-2012 at 08:12 PM (695 Views)
Complexity of the objects as well as classes increases along with the complexity of an application. Complex objects basically are manufactured of those parts that are produced by the various other objects which require special attention while building. A proper mechanism is needed by the application to build the complex objects, independent of those that build object. If you are also facing the same problems then try to use the Builder design pattern.
Such patterns permit the client object to build a complex object, just by making specification of its content and type. It is shielded of those details that are related to the representation of the object. In this way, the process of construction might be used so that to make different representations.This process has a logic that is different from the basic and actual steps that are used to create the complex objects. Therefore the process can again be used to make different object.
- An instance is defined to create the object but allowing the subclasses to take the decision that which class shall be instantiated.
- Via common interface, newly created objects are referred.