Version: 3.5.0

org.generationcp.core.datatransformer
Interface DataTransformerFactory


public interface DataTransformerFactory

An interface defining factories (creators) of data transformers. One factory usually creates similar data transformers that differ only in the value(s) passed to their constructors.

Why to use factories, at all?

A possible scenario would be to discover (using the SPI (Service Provider Interface) discovery mechanism) directly data transformers. This, however, works best when the discovered implementations of data transformers are using empty constructors. But in the real world many data transformers will be very similar (meaning: they will be represented by the same implementing class), and they would differ only by values given to them in the non-empty constructor. And here are factories to rescue the show:

A recommended (but not mandatory) scenario would be to use SPI to discover not data transformers but their factories. Each factory would read some configuration file where it finds which data transformers to create, and what values to give them in their constructors. Such factory would then return all its data transformers using getDataTransformers() method.

Version:
$Id: DataTransformerFactory.html 19678 2010-07-23 23:41:44Z jbmorales $
Author:
Martin Senger

Method Summary
 DataTransformer[] getDataTransformers()
          Return all data transformers created by this factory.
 

Method Detail

getDataTransformers

DataTransformer[] getDataTransformers()
Return all data transformers created by this factory.


Version: 3.5.0

Submit a bug or feature
Generated: Fri Jul 23 18:24:48 CDT 2010