com.ccg.beans
Interface ObjectFactory

All Known Implementing Classes:
NamedObjectFactory, ObjectFactoryAdapter

public interface ObjectFactory

Interface defining the methods which objects that act as "factories" for producing instances of other objects.

When designing software that allows one to dynamically plug-in implementations for various modules, it is often useful to use a "factory" to load and construct the implementations to be used. The factory has the following responsibility:

Since:
1.0
Version:
$Revision: 1.1 $
Author:
$Author: pkb $

Method Summary
 Object createObjectInstance()
          Creates a new instance of the type of associated object.
 Class getObjectClass()
          Get the associated object Class.
 

Method Detail

getObjectClass

Class getObjectClass()
                     throws IllegalStateException
Get the associated object Class.

Returns:
The associated Class - never returns null.
Throws:
IllegalStateException - If the associated class information is not available.
Since:
1.0

createObjectInstance

Object createObjectInstance()
                            throws IllegalStateException
Creates a new instance of the type of associated object.

This method can be used when you want to produce a "new" object.

Returns:
New instance of a object associated with the menu item (never returns null).
Throws:
IllegalStateException - If the class has not been set, or we could not create a new instance of the object using the newInstance method.
Since:
1.0


Copyright 1998-1998-2006 null. All Rights Reserved.