|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DataFactory
Base interface for all data factories responsible for loading and persisting data. Data factory is here to implement Data Access Object pattern as described in http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html or more generically the Abstract Factory pattern as described in http://homepage.mac.com/loeffler/java/patterns/absfac.html by GoF95 http://homepage.mac.com/loeffler/java/patterns.html. It's main purpose is to persist, retrieve and change the persisted data objects in the underlying persistence store without exposing any persistence store dependent information to the rest of the application. This interface doesn't dictate implementation therefore it is possible to have FileDataFactory, DatabaseDataFactory, etc.
| Method Summary | |
|---|---|
DataObject |
get(int iId,
int iDomainId)
Get specific data object identified by its id from the persistence store. |
int |
getDataType()
Get data type code for DataObject derived class managed by the data factory which implements this interface. |
| Method Detail |
|---|
int getDataType()
DataObject get(int iId,
int iDomainId)
throws OSSException
iId - - id of the data object to get, if the id is NEW_ID a new data
object initialized to default valuesiDomainId - - if the data object exists in a domain then by specifying
the domain id it allows the persistance store to limit
the data that will be searched and also possibly
enforce in what domain the id can possibly exist. This
allows to enforce security on the persistance layer
that by ensuring that if the data object doesn't exist
in the domain where it is expected to exist, it will
not be even retrieved. If the data object doesnt exist
in the domain, you can pass DataObject.NEW_ID here
since it won't be used.
OSSException - - an error while getting data
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||