|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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:
Class which it
is associated with (which may be set at run time).
| Method Summary | |
|---|---|
Object |
createObjectInstance()
Creates a new instance of the type of associated object. |
Class |
getObjectClass()
Get the associated object Class. |
| Method Detail |
|---|
Class getObjectClass()
throws IllegalStateException
Class.
Class - never returns null.
IllegalStateException - If the associated class information is not available.
Object createObjectInstance()
throws IllegalStateException
This method can be used when you want to produce a "new" object.
IllegalStateException - If the class has not been set, or we could not create a new
instance of the object using the newInstance method.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||