|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The type of the domain object for which this instance is to be
used.ID
- The type of the id of the domain object for which this instance is
to be used.S
- The type of criteria strategy used for searching objects.F
- The type of facets to specify the relations to be initialized when
loading an object.public interface GenericDaoReadOnlyWithFacets<T,ID extends Serializable,S extends org.janux.bus.search.SearchCriteria,F extends Enum<F>>
A data access object that uses a variation of the Fly Weight Pattern to retrieve specific subsets of an entity's object graph. In object oriented approaches, Business Entities are represented as object graphs, and data access objects are tasked with retrieving and storing these object graphs.
For complex entities, these object graphs can be extensive, involve multiple relationships, and entail a 'deep' retrieval from the storage mechanism, possibly one that is performance intensive. In certain contexts, it may be desirable to instantiate smaller object graphs that represents only a sub-set of the entities' information.
The pattern in this class defines the notion of a Facet as the various subsets of information that represent a complex entity, and leaves it to the developer to define Enumeration of such Facets, a Set of which can than be passed to the DAOs 'load' or 'find' method to determine at runtime the extent of the object graph that should be retrieved.
Method Summary | |
---|---|
Set<F> |
getDefaultFacetSetOnLoad()
Configure the default facet set on load |
void |
initialize(T entity,
F facet)
Explicitly initializes a specific facet (relationship) of an entity's object graph; the expectation is that this method will be called repeatedly in the 'load' method to initialize all the facets passed in the facet set. |
void |
initialize(T entity,
Set<F> facetSet)
Iterates over the provided facet set and initializes the entity accordingly |
T |
load(ID id,
Set<F> facetSet)
Loads an entity and initializes only the facets passed in the facet Set passed. |
void |
setDefaultFacetSetOnLoad(Set<F> facetSet)
TODO |
Methods inherited from interface org.janux.bus.persistence.GenericDaoReadOnly |
---|
count, findByCriteria, load |
Method Detail |
---|
Set<F> getDefaultFacetSetOnLoad()
void setDefaultFacetSetOnLoad(Set<F> facetSet)
facetSet
- T load(ID id, Set<F> facetSet) throws DataAccessException
id
- facetSet
-
DataAccessException
void initialize(T entity, F facet)
void initialize(T entity, Set<F> facetSet)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |