blob: 8020dd37f4af8e1c2dc3bf559ac1bb675a5e8fb7 [file] [log] [blame]
Title: Runtime Components
<H2><A name="RuntimeComponents-RuntimeComponents"></A>Runtime Components</H2>
<P>Cayenne runtime framework is an intermediary between a Java application and a relational database. The picture below shows the main components of the framework:</P>
<P><SPAN class="image-wrap" style=""><IMG src="runtime-components.data/cayenne-runtime.png" style="border: 0px solid black"></SPAN></P>
<H3><A name="RuntimeComponents-VerticalStructureCayennePersistenceStack"></A>Vertical Structure - Cayenne Persistence Stack</H3>
<P>Vertically this structure reflects the runtime organization of the Cayenne persistence stack. Cayenne instantiates and configures the stack (shown in yellow above) using the XML descriptors provided by the user (usually these are the XML files created by CayenneModeler). Alternatively <B>persistence stack can be assembled via the API</B> and/or using Spring or any similar approach. Moreover Cayenne stack is fully dynamic and <B>can be altered at runtime</B>, since currently (as of version 1.2) Cayenne does not rely on bytecode enhancement.</P>
<H3><A name="RuntimeComponents-HorizontalStructureCayenneLayers"></A>Horizontal Structure - Cayenne Layers</H3>
<P>The top Cayenne layer (ObjectContext, Query API, Expression API) is what the application needs to work with persistent objects. This layer implements Cayenne part of the <A href="cayenne-contract.html" title="Cayenne Contract">persistence contract</A> between the application and the framework, while underlying layers deal with details of the object-to-relational translation and data source interaction. Access to the mapping metadata and the stack objects residing in the lower layers is possible via the API.</P>
<H3><A name="RuntimeComponents-Sections"></A>Sections</H3>
<P>Many individual components of the framework are discussed in the following chapters:</P>
<OL>
<LI><A href="objectcontext.html" title="ObjectContext">ObjectContext</A></LI>
<LI><A href="entityresolver.html" title="EntityResolver">Mapping Metadata</A></LI>
<LI><A href="datachannel.html" title="DataChannel">DataChannel</A></LI>
<LI><A href="datanode.html" title="DataNode">DataNode</A></LI>
<LI><A href="dbadapter.html" title="DbAdapter">DbAdapter</A></LI>
<LI><A href="event-package.html" title="Event Package"><TT>org.apache.cayenne.event</TT></A> - event support package.</LI>
<LI><A href="datasource.html" title="DataSource"><TT>org.apache.cayenne.conn</TT></A> - DataSource package.</LI>
</OL>