com.emarsys.ecommon.builder
Interface Builder<T>

All Known Implementing Classes:
CalendarBuilder, DateBuilder, MockTimeBuilder, TimeBuilder

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.

Author:
Michael "kULO" Kulovits
See Also:
Builders

Method Summary
 T newInstance()
           Factory method that replaces the default constructor for new T instances.
 

Method Detail

newInstance

T newInstance()

Factory method that replaces the default constructor for new T instances.

Returns:
a new T instance, never null.


Copyright © 2010 emarsys AG. All Rights Reserved.