Factory
[Factories]

Collaboration diagram for Factory:Implements a generic object factory. More...


Modules

 Factory Error Policies
 Manages the "Unknown Type" error in an object factory.

Classes

class  Loki::Factory< AbstractProduct, IdentifierType, CreatorParmTList, FactoryErrorPolicy >


Detailed Description

Implements a generic object factory.

The Factory Method pattern is an object-oriented design pattern. Like other creational patterns, it deals with the problem of creating objects (products) without specifying the exact class of object that will be created. Factory Method, one of the patterns from the Design Patterns book, handles this problem by defining a separate method for creating the objects, which subclasses can then override to specify the derived type of product that will be created.
More generally, the term Factory Method is often used to refer to any method whose main purpose is creation of objects.

Wikipedia

Loki proposes a generic version of the Factory. Here is a typical use.

1. Factory< AbstractProduct, int > aFactory;
2. aFactory.Register( 1, createProductNull );
3. aFactory.CreateObject( 1 );



Generated on Sun Feb 25 16:52:29 2007 for Loki by  doxygen 1.5.1-p1