net.sourceforge.domian.factory
Class StrictConstructorOnlyReturnsNullFactory<T>

java.lang.Object
  extended by net.sourceforge.domian.factory.StrictConstructorOnlyReturnsNullFactory<T>
All Implemented Interfaces:
Factory

Deprecated. Will be replaced by StrictReturnsNullFactory, when available

public final class StrictConstructorOnlyReturnsNullFactory<T>
extends java.lang.Object
implements Factory

Generic factory class creating objects based on Specifications.

It is named strict because it rather returns null rather than a possible imperfect object. If the specification contains ambiguous data, or is somehow missing data, the factory will not construct any object.

Returns null object creation strategy means that the factory will silently return null when the first show-stopping obstacle occurs.

In addition, this factory is kind of dumb, as it demands that a constructor with all necessary parameters is available. That is why it is deprecated on arrival.

Since:
0.4
Author:
Eirik Torske

Constructor Summary
StrictConstructorOnlyReturnsNullFactory()
          Deprecated.  
 
Method Summary
 T create(Specification specification)
          Deprecated. Alias of createObjectSpecifiedBy().
 T createObjectSpecifiedBy(Specification specification)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrictConstructorOnlyReturnsNullFactory

public StrictConstructorOnlyReturnsNullFactory()
Deprecated. 
Method Detail

createObjectSpecifiedBy

public T createObjectSpecifiedBy(Specification specification)
Deprecated. 
Specified by:
createObjectSpecifiedBy in interface Factory
Returns:
an instance of type T, specified by given Specification; otherwise further events is based on factory implementation strategy

create

public T create(Specification specification)
Deprecated. 
Description copied from interface: Factory
Alias of createObjectSpecifiedBy().

Specified by:
create in interface Factory


Copyright © 2006-2009. All Rights Reserved.