From: Michael D. <mik...@us...> - 2005-02-28 03:36:41
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8549 Modified Files: architecture.xml basic_mapping.xml Log Message: updates to the docs. Index: basic_mapping.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/en/modules/basic_mapping.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** basic_mapping.xml 23 Jan 2005 04:34:56 -0000 1.9 --- basic_mapping.xml 28 Feb 2005 03:36:28 -0000 1.10 *************** *** 34,59 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="Eg.Cat, Eg" table="CATS" discriminator-value="C"> ! <id name="Id" column="uid" type="Int64"> ! <generator class="hilo"/> ! </id> ! <discriminator column="subclass" type="Char"/> ! <property name="Birthdate" type="Date"/> ! <property name="Color" not-null="true"/> ! <property name="Sex" not-null="true" update="false"/> [...1370 lines suppressed...] ! It is possible to define <literal>subclass</literal> and <literal>joined-subclass</literal> ! mappings in seperate mapping documents, directly beneath <literal>hibernate-mapping</literal>. ! This allows you to extend a class hierachy just by adding a new mapping file. You must ! specify an <literal>extends</literal> attribute in the subclass mapping, naming a previously ! mapped superclass. If you are configuring NHibernate by using Embedded Resources then the ! hbm.xml files are configured in the correct order. If you are manually adding them or specifying ! them in the cfg.xml file then the ordering of the mapping documents is important! ! </para> ! ! <programlisting><![CDATA[ ! <hibernate-mapping> ! <subclass name="Eg.Subclass.DomesticCat, Eg" extends="Eg.Cat, Eg" discriminator-value="D"> ! <property name="Name" type="String"/> ! </subclass> ! </hibernate-mapping>]]></programlisting> ! ! </sect1> </chapter> \ No newline at end of file Index: architecture.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/en/modules/architecture.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** architecture.xml 25 Oct 2004 05:20:08 -0000 1.4 --- architecture.xml 28 Feb 2005 03:36:28 -0000 1.5 *************** *** 9,166 **** <chapter id="architecture"> ! <title>Architecture</title> ! <sect1 id="architecture-overview"> ! <title>Overview</title> ! ! <para> ! A (very) high-level view of the NHibernate architecture: ! </para> ! <mediaobject> ! <!-- ! <imageobject role="fo"> ! <imagedata fileref="../images/overview.svg" format="SVG" align="center"/> ! </imageobject> --> ! <imageobject role="html"> ! <imagedata fileref="../images/overview.gif" format="GIF" align="center"/> ! </imageobject> ! </mediaobject> ! <para> ! This diagram shows NHibernate using the database and configuration data to ! provide persistence services (and persistent objects) to the application. ! </para> ! <para> ! We would like to show a more detailed view of the runtime architecture. ! Unfortunately, NHibernate is flexible and supports several approaches. We will ! show the two extremes. The "lite" architecture has the application ! provide its own ADO.NET connections and manage its own transactions. This approach ! uses a minimal subset of NHibernate's APIs: ! </para> <mediaobject> ! <!-- <imageobject role="fo"> ! <imagedata fileref="../images/lite.svg" format="SVG" align="center"/> ! </imageobject> --> ! <imageobject role="html"> ! <imagedata fileref="../images/lite.gif" format="GIF" align="center"/> ! </imageobject> ! </mediaobject> ! ! <para> ! The "full cream" architecture abstracts the application away from the ! underlying ADO.NET API and lets NHibernate take care of the details. ! </para> ! <!-- TODO: make images --> <mediaobject> ! <!-- <imageobject role="fo"> ! <imagedata fileref="../images/full_cream.svg" format="SVG" align="center"/> ! </imageobject> --> ! <imageobject role="html"> ! <imagedata fileref="../images/full_cream.gif" format="GIF" align="center"/> ! </imageobject> ! </mediaobject> ! ! <para> ! Heres some definitions of the objects in the diagrams: ! ! <variablelist> ! <varlistentry> ! <term>SessionFactory (<literal>NHibernate.ISessionFactory</literal>)</term> ! <listitem> ! <para> ! A threadsafe (immutable) cache of compiled mappings for a single database. ! A factory for <literal>Session</literal> and a client of ! <literal>ConnectionProvider</literal>. Might hold an optional (second-level) ! cache of data that is reusable between transactions, at a ! process- or cluster-level. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>Session (<literal>NHibernate.ISession</literal>)</term> ! <listitem> ! <para> ! A single-threaded, short-lived object representing a conversation between ! the application and the persistent store. Wraps an ADO.NET connection. Factory ! for <literal>Transaction</literal>. Holds a mandatory (first-level) cache ! of persistent objects, used when navigating the object graph or looking up ! objects by identifier. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>Persistent Objects and Collections</term> ! <listitem> ! <para> ! Short-lived, single threaded objects containing persistent state and business ! function. These might be ordinary objects, the only special thing about ! them is that they are currently associated with (exactly one) ! <literal>Session</literal>. As soon as the <literal>Session</literal> is closed, ! they will be detached and free to use in any application layer (e.g. directly ! as data transfer objects to and from presentation). ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>Transient Objects and Collections</term> ! <listitem> ! <para> ! Instances of persistent classes that are not currently associated with a ! <literal>Session</literal>. They may have been instantiated by ! the application and not (yet) persisted or they may have been instantiated by a ! closed <literal>Session</literal>. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>Transaction (<literal>NHibernate.ITransaction</literal>)</term> ! <listitem> ! <para> ! (Optional) A single-threaded, short-lived object used by the application to ! specify atomic units of work. Abstracts application from underlying ADO.NET ! transaction. A <literal>Session</literal> might span several ! <literal>Transaction</literal>s in some cases. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>ConnectionProvider (<literal>NHibernate.Connection.ConnectionProvider</literal>)</term> ! <listitem> ! <para> ! (Optional) A factory for ADO.NET connections. Abstracts application from ! underlying <literal>IDbConnection</literal>. Not exposed to application, ! but can be extended/implemented by the developer. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>TransactionFactory (<literal>net.sf.hibernate.TransactionFactory</literal>)</term> ! <listitem> ! <para> ! (Optional) A factory for <literal>Transaction</literal> instances. Not exposed to the ! application, but can be extended/implemented by the developer. ! </para> ! </listitem> ! </varlistentry> ! </variablelist> ! </para> ! <para> ! Given a "lite" architecture, the application bypasses the ! <literal>Transaction</literal>/<literal>TransactionFactory</literal> and/or ! <literal>ConnectionProvider</literal> APIs to talk to ADO.NET directly. ! </para> ! </sect1> ! </chapter> --- 9,163 ---- <chapter id="architecture"> ! <title>Architecture</title> ! <sect1 id="architecture-overview"> ! <title>Overview</title> ! ! <para> ! A (very) high-level view of the NHibernate architecture: ! </para> ! <mediaobject> ! <!-- ! <imageobject role="fo"> ! <imagedata fileref="../images/overview.svg" format="SVG" align="center"/> ! </imageobject> --> ! <imageobject role="html"> ! <imagedata fileref="../images/overview.gif" format="GIF" align="center"/> ! </imageobject> ! </mediaobject> ! <para> ! This diagram shows NHibernate using the database and configuration data to ! provide persistence services (and persistent objects) to the application. ! </para> ! <para> ! We would like to show a more detailed view of the runtime architecture. ! Unfortunately, NHibernate is flexible and supports several approaches. We will ! show the two extremes. The "lite" architecture has the application ! provide its own ADO.NET connections and manage its own transactions. This approach ! uses a minimal subset of NHibernate's APIs: ! </para> <mediaobject> ! <!-- <imageobject role="fo"> ! <imagedata fileref="../images/lite.svg" format="SVG" align="center"/> ! </imageobject> --> ! <imageobject role="html"> ! <imagedata fileref="../images/lite.gif" format="GIF" align="center"/> ! </imageobject> ! </mediaobject> ! ! <para> ! The "full cream" architecture abstracts the application away from the ! underlying ADO.NET API and lets NHibernate take care of the details. ! </para> ! <!-- TODO: make images --> <mediaobject> ! <!-- <imageobject role="fo"> ! <imagedata fileref="../images/full_cream.svg" format="SVG" align="center"/> ! </imageobject> --> ! <imageobject role="html"> ! <imagedata fileref="../images/full_cream.gif" format="GIF" align="center"/> ! </imageobject> ! </mediaobject> ! <para> ! Heres some definitions of the objects in the diagrams: ! <variablelist> ! <varlistentry> ! <term>SessionFactory (<literal>NHibernate.ISessionFactory</literal>)</term> ! <listitem> ! <para> ! A threadsafe (immutable) cache of compiled mappings for a single database. ! A factory for <literal>Session</literal> and a client of ! <literal>ConnectionProvider</literal>. Might hold an optional (second-level) ! cache of data that is reusable between transactions, at a ! process- or cluster-level. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>Session (<literal>NHibernate.ISession</literal>)</term> ! <listitem> ! <para> ! A single-threaded, short-lived object representing a conversation between ! the application and the persistent store. Wraps an ADO.NET connection. Factory ! for <literal>Transaction</literal>. Holds a mandatory (first-level) cache ! of persistent objects, used when navigating the object graph or looking up ! objects by identifier. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>Persistent Objects and Collections</term> ! <listitem> ! <para> ! Short-lived, single threaded objects containing persistent state and business ! function. These might be ordinary objects, the only special thing about ! them is that they are currently associated with (exactly one) ! <literal>Session</literal>. As soon as the <literal>Session</literal> is closed, ! they will be detached and free to use in any application layer (e.g. directly ! as data transfer objects to and from presentation). ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>Transient Objects and Collections</term> ! <listitem> ! <para> ! Instances of persistent classes that are not currently associated with a ! <literal>Session</literal>. They may have been instantiated by ! the application and not (yet) persisted or they may have been instantiated by a ! closed <literal>Session</literal>. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>Transaction (<literal>NHibernate.ITransaction</literal>)</term> ! <listitem> ! <para> ! (Optional) A single-threaded, short-lived object used by the application to ! specify atomic units of work. Abstracts application from underlying ADO.NET ! transaction. A <literal>Session</literal> might span several ! <literal>Transaction</literal>s in some cases. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>ConnectionProvider (<literal>NHibernate.Connection.ConnectionProvider</literal>)</term> ! <listitem> ! <para> ! (Optional) A factory for ADO.NET connections. Abstracts application from ! underlying <literal>IDbConnection</literal>. Not exposed to application, ! but can be extended/implemented by the developer. ! </para> ! </listitem> ! </varlistentry> ! <varlistentry> ! <term>TransactionFactory (<literal>net.sf.hibernate.TransactionFactory</literal>)</term> ! <listitem> ! <para> ! (Optional) A factory for <literal>Transaction</literal> instances. Not exposed to the ! application, but can be extended/implemented by the developer. ! </para> ! </listitem> ! </varlistentry> ! </variablelist> ! </para> + <para> + Given a "lite" architecture, the application bypasses the + <literal>Transaction</literal>/<literal>TransactionFactory</literal> and/or + <literal>ConnectionProvider</literal> APIs to talk to ADO.NET directly. + </para> + </sect1> </chapter> |