org.janux.bus.persistence
Interface GenericDaoReadOnlyWithFacets<T,ID extends Serializable,S extends org.janux.bus.search.SearchCriteria,F extends Enum<F>>

Type Parameters:
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.
All Superinterfaces:
GenericDaoReadOnly<T,ID,S>
All Known Subinterfaces:
AccountDaoGeneric<T>, AccountPartyDaoGeneric<T>, OrganizationDaoGeneric<T>, PartyDaoGeneric<T>, PersonDaoGeneric<T>

public interface GenericDaoReadOnlyWithFacets<T,ID extends Serializable,S extends org.janux.bus.search.SearchCriteria,F extends Enum<F>>
extends GenericDaoReadOnly<T,ID,S>

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.

Since:
0.4
Author:
Daniel Mora, Philippe Paravicini

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

getDefaultFacetSetOnLoad

Set<F> getDefaultFacetSetOnLoad()
Configure the default facet set on load


setDefaultFacetSetOnLoad

void setDefaultFacetSetOnLoad(Set<F> facetSet)
TODO

Parameters:
facetSet -

load

T load(ID id,
       Set<F> facetSet)
       throws DataAccessException
Loads an entity and initializes only the facets passed in the facet Set passed.

Parameters:
id -
facetSet -
Throws:
DataAccessException

initialize

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.


initialize

void initialize(T entity,
                Set<F> facetSet)
Iterates over the provided facet set and initializes the entity accordingly



Copyright © 2005-2013 Janux. All Rights Reserved.