com.fdsapi
Class DataSetFactory

java.lang.Object
  |
  +--com.fdsapi.DataSetFactory

public class DataSetFactory
extends java.lang.Object

This class is used to create DataSet objects. DataSet's are used to turn tabular data into text such as HTML, or XML (for example an HTML table, or a drop down list box), or to execute any logic against the underlying tabular data.

The code in this class uses a number of patterns the "Design Patterns" book by Gamma, Helm, Johnson and Vlissides and published by Addison Wesley. It primarily uses the creational patterns: Abstract Factory, Builder, Factory Method, and Singleton.

The general idea of all of the creational patterns is to make the creation of objects simpler and more flexible. In the case of DataSet's this is particularly important because DataSet's consist of many objects and would be difficult to create each time by executing all of the individual steps.

Developers may enhance the capabilities of DataSet's by checking there own DataSets into the factory.



View Code


Constructor Summary
protected DataSetFactory()
          Populate the DataSetFactory with its default objects.
 
Method Summary
static DataSetFactory createInstance()
           
 void setDataSetFactoryMaster(java.lang.String type, DataSet dataSet)
          Register a DataSet into the factory.
 void setDefaultTemplate(java.lang.String defaultTemplate)
          If the predefined default Template string is not satisfactory it may be replaced.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSetFactory

protected DataSetFactory()
Populate the DataSetFactory with its default objects. Developers may check there own DataSets into the factory. Note each DataSet knows how to create itself.

Method Detail

createInstance

public static DataSetFactory createInstance()

setDataSetFactoryMaster

public void setDataSetFactoryMaster(java.lang.String type,
                                    DataSet dataSet)

Register a DataSet into the factory. After the DataSet is registered it can be used in templates by entering: Type==email

Sample call:

        DataSetFactory.setDataSetFactoryMaster("email", new EmailDataSet());
     


setDefaultTemplate

public void setDefaultTemplate(java.lang.String defaultTemplate)
If the predefined default Template string is not satisfactory it may be replaced. Be careful when using this method as all templates implicitly inherit from it.