Visit Map

Saturday, May 19, 2007

GOF Creational pattern - Abstract Factory

More than Factory – allows creation of class families
Go to Sears and order a kitchen make-over. Same order request process can yield very different kitchen drawers, doors and hardware
Provide an interface for creating families of related or dependent objects without specifying their concrete classes

The abstract factory's intent is to provide an interface to use for creating families of related or dependent or dependent objects without actually specifying their concrete classes. For a given set of related abstract classes, this pattern supplies a technique for creating instances of those abstract classes from an equivalent set of concrete subclasses. On some occasions, you may need to create an object without having to know which concrete subclass of object to create.

The abstract factory pattern is also know as Kit.

Benefits

It isolates client from concrete classes.

It eases the exchanging of object families

It promotes consistency among objects

The base GOF patterns are divided into 3 types

Creational

Structural

Behavioral

The Abstract factory pattren come under the creational patterns
J2EE Applicability of Abstract Factory
DAO
Value Object Assembler