|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Builder<T>
A Builder
is a default factory for
objects of type T and used to create
common objects in a unified way throughout the system.
Builders serve as a substitution for default constructors of common, often used objects in order to be able to change the default implementation of such objects' creation. The main use case for this would be the use of mock implementations for testing purposes.
A Builder
itself must provide a default constructor!
Note that Builders
are not intended to provide
yet another dependency injection mechanism but in the first
line are an attempt to fix some of the shortcomings of
third party classes such as those in the JDK without introducing
to many depencies on applications or systems based on
the ecommon library.
Builders
Method Summary | |
---|---|
T |
newInstance()
Factory method that replaces the default constructor for new T instances. |
Method Detail |
---|
T newInstance()
Factory method that replaces the default constructor for new T instances.
null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |