<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://nhforge.org/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Architecture</title><link>http://nhforge.org/wikis/reference2-0en/architecture.aspx</link><description>Read reference documentation for a number of NHibernate 2.0 APIs. </description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Architecture</title><link>http://nhforge.org/wikis/reference2-0en/architecture.aspx</link><pubDate>Thu, 24 Feb 2011 00:50:31 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:5</guid><dc:creator>Groxx</dc:creator><comments>http://nhforge.org/wikis/reference2-0en/architecture/comments.aspx</comments><description>Current revision posted to NHibernate 2.0  by Groxx on 23/02/2011 09:50:31 p.m.&lt;br /&gt;
&lt;h2&gt;Architecture&lt;/h2&gt;
&lt;div style="font-size: 90%;"&gt;Filed under: &lt;span style="background: SpringGreen;"&gt;Architecture&lt;/span&gt;&lt;span style="background: SpringGreen;"&gt;,&lt;/span&gt; Session, SessionFactory&lt;span style="text-decoration: line-through; color: red;"&gt;,&lt;/span&gt; &lt;span style="text-decoration: line-through; color: red;"&gt;Architecture&lt;/span&gt;&lt;/div&gt;

&lt;h4&gt;
&lt;/h4&gt;
&lt;h4&gt;&lt;strong&gt;&lt;span style="color:#ff8000;"&gt;Wiki extracted from the &lt;a href="/doc/nh/en/index.html#architecture"&gt;2.0 Reference Documentation&lt;/a&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;h4&gt;Overview&lt;/h4&gt;
&lt;p&gt;A (very) high-level view of the NHibernate architecture: 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img style="vertical-align:middle;margin-left:200px;margin-right:200px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/overview.png" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/overview.png" style="vertical-align:middle;margin-left:200px;margin-right:200px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This diagram shows NHibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. 
&lt;/p&gt;
&lt;p&gt;We would like to show a more detailed view of the runtime architecture. Unortunately, NHibernate is flexible and supports several approaches. We will show the two extremes. The &amp;quot;lite&amp;quot; architecture has the application provide its own ADO.NET connections and manage its own transactions. This approach uses a minimal subset of NHibernate&amp;#39;s APIs: 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img style="margin-left:150px;margin-right:150px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/lite.png" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/lite.png" style="margin-left:150px;margin-right:150px;" alt="" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The &amp;quot;full cream&amp;quot; architecture abstracts the application away from the underlying ADO.NET APIs and lets NHibernate take care of the details. 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img style="margin-left:100px;margin-right:100px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/fullcream.png" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/fullcream.png" style="margin-left:100px;margin-right:100px;" alt="" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here some definitions of the objects in the diagrams: 
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ISessionFactory&lt;/strong&gt; (NHibernate.ISessionFactory)&lt;/p&gt;
&lt;p&gt;A threadsafe (immutable) cache of compiled mappings for a single database. A factory for &lt;i&gt;ISession&lt;/i&gt; and a client of &lt;i&gt;IConnectionProvider&lt;/i&gt;. Might hold an optional (second-level) cache of data that is reusable between transactions, at a process- or cluster-level. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ISession&lt;/strong&gt; (NHibernate.ISession)&lt;/p&gt;
&lt;p&gt;A single-threaded, short-lived object representing a conversation between the application and the persistent store. Wraps an ADO.NET connection. Factory for &lt;i&gt;ITransaction&lt;/i&gt;. Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier. 
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Persistent Objects and Collection&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;Short-lived, single threaded objects containing persistent state and business function. These might be ordinary POCOs &lt;span style="background: SpringGreen;"&gt;(&lt;/span&gt;&lt;span style="background: SpringGreen;"&gt;Plain&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;Old&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;CLR&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;Objects)&lt;/span&gt;, the only special thing about them is that they are currently associated with (exactly one) &lt;i&gt;ISession&lt;/i&gt;. As soon as the &lt;i&gt;Session&lt;/i&gt; 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). 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Transient Objects and Collections &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Instances of persistent classes that are not currently associated with a &lt;i&gt;ISession&lt;/i&gt;. They may have been instantiated by the application and not (yet) persisted or they may have been instantiated by a closed &lt;i&gt;ISession&lt;/i&gt;. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;ITransaction&lt;/strong&gt; (NHibernate.ITransaction)&lt;/p&gt;
&lt;p&gt;(Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. Abstracts application from underlying ADO.NET transaction. An &lt;i&gt;ISession&lt;/i&gt; might span several &lt;i&gt;ITransaction&lt;/i&gt;s in some cases. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IConnectionProvider &lt;/strong&gt;(NHibernate.Connection.IConnectionProvider)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for ADO.NET connections and commands. Abstracts application from the concrete vendor-specific implementations of &lt;i&gt;IDbConnection&lt;/i&gt; and &lt;i&gt;IDbCommand&lt;/i&gt;. Not exposed to application, but can be extended/implemented by the developer. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IDriver &lt;/strong&gt;(NHibernate.Driver.IDriver)&lt;/p&gt;
&lt;p&gt;(Optional) An interface encapsulating differences between ADO.NET providers, such as parameter naming conventions and supported ADO.NET features. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ITransactionFactory &lt;/strong&gt;(NHibernate.Transaction.ITransactionFactory)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for &lt;i&gt;ITransaction&lt;/i&gt; instances. Not exposed to the application, but can be extended/implemented by the developer. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Given a &amp;quot;lite&amp;quot; architecture, the application bypasses the &lt;i&gt;ITransaction&lt;/i&gt;, &lt;i&gt;ITransactionFactory&lt;/i&gt; and/or &lt;i&gt;IConnectionProvider&lt;/i&gt; APIs to talk to ADO.NET directly. 
&lt;/p&gt;</description></item><item><title>Architecture</title><link>http://nhforge.org/wikis/reference2-0en/architecture/revision/9.aspx</link><pubDate>Thu, 24 Feb 2011 00:49:12 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:362</guid><dc:creator>Groxx</dc:creator><comments>http://nhforge.org/wikis/reference2-0en/architecture/comments.aspx</comments><description>Revision 9 posted to NHibernate 2.0  by Groxx on 23/02/2011 09:49:12 p.m.&lt;br /&gt;
&lt;h2&gt;Architecture&lt;/h2&gt;
&lt;div style="font-size: 90%;"&gt;Filed under: Session, SessionFactory, Architecture&lt;/div&gt;

&lt;h4&gt;
&lt;/h4&gt;
&lt;h4&gt;&lt;strong&gt;&lt;span style="color:#ff8000;"&gt;&lt;span style="background: SpringGreen;"&gt;Wiki&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;extracted&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;from&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;the&lt;/span&gt; &lt;a href="/doc/nh/en/index.html#architecture"&gt;&lt;span style="background: SpringGreen;"&gt;2.0&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;Reference&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;Documentation&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;h4&gt;Overview&lt;/h4&gt;
&lt;p&gt;A (very) high-level view of the NHibernate architecture: 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/overview.png" style="vertical-align:middle;margin-left:200px;margin-right:200px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img style="vertical-align:middle;margin-left:200px;margin-right:200px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/overview.png" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This diagram shows NHibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. 
&lt;/p&gt;
&lt;p&gt;We would like to show a more detailed view of the runtime architecture. &lt;span style="text-decoration: line-through; color: red;"&gt;Fortunately&lt;/span&gt;&lt;span style="background: SpringGreen;"&gt;Unortunately&lt;/span&gt;, NHibernate is flexible and supports several approaches. We will show the two extremes. The &amp;quot;lite&amp;quot; architecture has the application provide its own ADO.NET connections and manage its own transactions. This approach uses a minimal subset of NHibernate&amp;#39;s APIs: 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/lite.png" style="margin-left:150px;margin-right:150px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img style="margin-left:150px;margin-right:150px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/lite.png" alt="" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The &amp;quot;full cream&amp;quot; architecture abstracts the application away from the underlying ADO.NET APIs and lets NHibernate take care of the details. 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/fullcream.png" style="margin-left:100px;margin-right:100px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img style="margin-left:100px;margin-right:100px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/fullcream.png" alt="" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here some definitions of the objects in the diagrams: 
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ISessionFactory&lt;/strong&gt; (NHibernate.ISessionFactory)&lt;/p&gt;
&lt;p&gt;A threadsafe (immutable) cache of compiled mappings for a single database. A factory for &lt;i&gt;ISession&lt;/i&gt; and a client of &lt;i&gt;IConnectionProvider&lt;/i&gt;. Might hold an optional (second-level) cache of data that is reusable between transactions, at a process- or cluster-level. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ISession&lt;/strong&gt; (NHibernate.ISession)&lt;/p&gt;
&lt;p&gt;A single-threaded, short-lived object representing a conversation between the application and the persistent store. Wraps an ADO.NET connection. Factory for &lt;i&gt;ITransaction&lt;/i&gt;. Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier. 
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Persistent Objects and Collection&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;Short-lived, single threaded objects containing persistent state and business function. These might be ordinary POCOs, the only special thing about them is that they are currently associated with (exactly one) &lt;i&gt;ISession&lt;/i&gt;. As soon as the &lt;i&gt;Session&lt;/i&gt; 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). 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Transient Objects and Collections &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Instances of persistent classes that are not currently associated with a &lt;i&gt;ISession&lt;/i&gt;. They may have been instantiated by the application and not (yet) persisted or they may have been instantiated by a closed &lt;i&gt;ISession&lt;/i&gt;. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;ITransaction&lt;/strong&gt; (NHibernate.ITransaction)&lt;/p&gt;
&lt;p&gt;(Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. Abstracts application from underlying ADO.NET transaction. An &lt;i&gt;ISession&lt;/i&gt; might span several &lt;i&gt;ITransaction&lt;/i&gt;s in some cases. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IConnectionProvider &lt;/strong&gt;(NHibernate.Connection.IConnectionProvider)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for ADO.NET connections and commands. Abstracts application from the concrete vendor-specific implementations of &lt;i&gt;IDbConnection&lt;/i&gt; and &lt;i&gt;IDbCommand&lt;/i&gt;. Not exposed to application, but can be extended/implemented by the developer. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IDriver &lt;/strong&gt;(NHibernate.Driver.IDriver)&lt;/p&gt;
&lt;p&gt;(Optional) An interface encapsulating differences between ADO.NET providers, such as parameter naming conventions and supported ADO.NET features. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ITransactionFactory &lt;/strong&gt;(NHibernate.Transaction.ITransactionFactory)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for &lt;i&gt;ITransaction&lt;/i&gt; instances. Not exposed to the application, but can be extended/implemented by the developer. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Given a &amp;quot;lite&amp;quot; architecture, the application bypasses the &lt;i&gt;ITransaction&lt;/i&gt;, &lt;i&gt;ITransactionFactory&lt;/i&gt; and/or &lt;i&gt;IConnectionProvider&lt;/i&gt; APIs to talk to ADO.NET directly. 
&lt;/p&gt;</description></item><item><title>Architecture</title><link>http://nhforge.org/wikis/reference2-0en/architecture/revision/8.aspx</link><pubDate>Thu, 24 Feb 2011 00:16:07 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:361</guid><dc:creator>Groxx</dc:creator><comments>http://nhforge.org/wikis/reference2-0en/architecture/comments.aspx</comments><description>Revision 8 posted to NHibernate 2.0  by Groxx on 23/02/2011 09:16:07 p.m.&lt;br /&gt;
&lt;h2&gt;Architecture&lt;/h2&gt;
&lt;div style="font-size: 90%;"&gt;Filed under: Session, SessionFactory, Architecture&lt;/div&gt;

&lt;h4&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;A (very) high-level view of the NHibernate architecture: 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img style="vertical-align:middle;margin-left:200px;margin-right:200px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/overview.png" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/overview.png" style="vertical-align:middle;margin-left:200px;margin-right:200px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This diagram shows NHibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. 
&lt;/p&gt;
&lt;p&gt;We would like to show a more detailed view of the runtime architecture. &lt;span style="text-decoration: line-through; color: red;"&gt;Unfortunately&lt;/span&gt;&lt;span style="background: SpringGreen;"&gt;Fortunately&lt;/span&gt;, NHibernate is flexible and supports several approaches. We will show the two extremes. The &amp;quot;lite&amp;quot; architecture has the application provide its own ADO.NET connections and manage its own transactions. This approach uses a minimal subset of NHibernate&amp;#39;s APIs: 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img style="margin-left:150px;margin-right:150px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/lite.png" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/lite.png" style="margin-left:150px;margin-right:150px;" alt="" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The &amp;quot;full cream&amp;quot; architecture abstracts the application away from the underlying ADO.NET APIs and lets NHibernate take care of the details. 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img style="margin-left:100px;margin-right:100px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/fullcream.png" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/fullcream.png" style="margin-left:100px;margin-right:100px;" alt="" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here some definitions of the objects in the diagrams: 
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ISessionFactory&lt;/strong&gt; (NHibernate.ISessionFactory)&lt;/p&gt;
&lt;p&gt;A threadsafe (immutable) cache of compiled mappings for a single database. A factory for &lt;i&gt;ISession&lt;/i&gt; and a client of &lt;i&gt;IConnectionProvider&lt;/i&gt;. Might hold an optional (second-level) cache of data that is reusable between transactions, at a process- or cluster-level. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ISession&lt;/strong&gt; (NHibernate.ISession)&lt;/p&gt;
&lt;p&gt;A single-threaded, short-lived object representing a conversation between the application and the persistent store. Wraps an ADO.NET connection. Factory for &lt;i&gt;ITransaction&lt;/i&gt;. Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier. 
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Persistent Objects and Collection&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;Short-lived, single threaded objects containing persistent state and business function. These might be ordinary POCOs, the only special thing about them is that they are currently associated with (exactly one) &lt;i&gt;ISession&lt;/i&gt;. As soon as the &lt;i&gt;Session&lt;/i&gt; 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). 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Transient Objects and Collections &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Instances of persistent classes that are not currently associated with a &lt;i&gt;ISession&lt;/i&gt;. They may have been instantiated by the application and not (yet) persisted or they may have been instantiated by a closed &lt;i&gt;ISession&lt;/i&gt;. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;ITransaction&lt;/strong&gt; (NHibernate.ITransaction)&lt;/p&gt;
&lt;p&gt;(Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. Abstracts application from underlying ADO.NET transaction. An &lt;i&gt;ISession&lt;/i&gt; might span several &lt;i&gt;ITransaction&lt;/i&gt;s in some cases. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IConnectionProvider &lt;/strong&gt;(NHibernate.Connection.IConnectionProvider)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for ADO.NET connections and commands. Abstracts application from the concrete vendor-specific implementations of &lt;i&gt;IDbConnection&lt;/i&gt; and &lt;i&gt;IDbCommand&lt;/i&gt;. Not exposed to application, but can be extended/implemented by the developer. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IDriver &lt;/strong&gt;(NHibernate.Driver.IDriver)&lt;/p&gt;
&lt;p&gt;(Optional) An interface encapsulating differences between ADO.NET providers, such as parameter naming conventions and supported ADO.NET features. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ITransactionFactory &lt;/strong&gt;(NHibernate.Transaction.ITransactionFactory)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for &lt;i&gt;ITransaction&lt;/i&gt; instances. Not exposed to the application, but can be extended/implemented by the developer. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Given a &amp;quot;lite&amp;quot; architecture, the application bypasses the &lt;i&gt;ITransaction&lt;/i&gt;, &lt;i&gt;ITransactionFactory&lt;/i&gt; and/or &lt;i&gt;IConnectionProvider&lt;/i&gt; APIs to talk to ADO.NET directly. 
&lt;/p&gt;</description></item><item><title>Architecture</title><link>http://nhforge.org/wikis/reference2-0en/architecture/revision/7.aspx</link><pubDate>Fri, 05 Sep 2008 23:28:53 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:360</guid><dc:creator>Fabio Maulo</dc:creator><comments>http://nhforge.org/wikis/reference2-0en/architecture/comments.aspx</comments><description>Revision 7 posted to NHibernate 2.0  by Fabio Maulo on 05/09/2008 08:28:53 p.m.&lt;br /&gt;
&lt;h2&gt;Architecture&lt;/h2&gt;
&lt;div style="font-size: 90%;"&gt;Filed under: &lt;span style="background: SpringGreen;"&gt;Session&lt;/span&gt;&lt;span style="background: SpringGreen;"&gt;,&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;SessionFactory&lt;/span&gt;&lt;span style="background: SpringGreen;"&gt;,&lt;/span&gt; &lt;span style="background: SpringGreen;"&gt;Architecture&lt;/span&gt;&lt;/div&gt;

&lt;h4&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;A (very) high-level view of the NHibernate architecture: 
&lt;/p&gt;
&lt;p&gt;&lt;img style="vertical-align:middle;margin-left:200px;margin-right:200px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/overview.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;This diagram shows NHibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. 
&lt;/p&gt;
&lt;p&gt;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 &amp;quot;lite&amp;quot; architecture has the application provide its own ADO.NET connections and manage its own transactions. This approach uses a minimal subset of NHibernate&amp;#39;s APIs: 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;img style="margin-left:150px;margin-right:150px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/lite.png" alt="" /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The &amp;quot;full cream&amp;quot; architecture abstracts the application away from the underlying ADO.NET APIs and lets NHibernate take care of the details. 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;img style="margin-left:100px;margin-right:100px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/fullcream.png" alt="" /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here some definitions of the objects in the diagrams: 
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ISessionFactory&lt;/strong&gt; (NHibernate.ISessionFactory)&lt;/p&gt;
&lt;p&gt;A threadsafe (immutable) cache of compiled mappings for a single database. A factory for &lt;i&gt;ISession&lt;/i&gt; and a client of &lt;i&gt;IConnectionProvider&lt;/i&gt;. Might hold an optional (second-level) cache of data that is reusable between transactions, at a process- or cluster-level. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ISession&lt;/strong&gt; (NHibernate.ISession)&lt;/p&gt;
&lt;p&gt;A single-threaded, short-lived object representing a conversation between the application and the persistent store. Wraps an ADO.NET connection. Factory for &lt;i&gt;ITransaction&lt;/i&gt;. Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier. 
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Persistent Objects and Collection&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;Short-lived, single threaded objects containing persistent state and business function. These might be ordinary POCOs, the only special thing about them is that they are currently associated with (exactly one) &lt;i&gt;ISession&lt;/i&gt;. As soon as the &lt;i&gt;Session&lt;/i&gt; 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). 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Transient Objects and Collections &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Instances of persistent classes that are not currently associated with a &lt;i&gt;ISession&lt;/i&gt;. They may have been instantiated by the application and not (yet) persisted or they may have been instantiated by a closed &lt;i&gt;ISession&lt;/i&gt;. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;ITransaction&lt;/strong&gt; (NHibernate.ITransaction)&lt;/p&gt;
&lt;p&gt;(Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. Abstracts application from underlying ADO.NET transaction. An &lt;i&gt;ISession&lt;/i&gt; might span several &lt;i&gt;ITransaction&lt;/i&gt;s in some cases. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IConnectionProvider &lt;/strong&gt;(NHibernate.Connection.IConnectionProvider)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for ADO.NET connections and commands. Abstracts application from the concrete vendor-specific implementations of &lt;i&gt;IDbConnection&lt;/i&gt; and &lt;i&gt;IDbCommand&lt;/i&gt;. Not exposed to application, but can be extended/implemented by the developer. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IDriver &lt;/strong&gt;(NHibernate.Driver.IDriver)&lt;/p&gt;
&lt;p&gt;(Optional) An interface encapsulating differences between ADO.NET providers, such as parameter naming conventions and supported ADO.NET features. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ITransactionFactory &lt;/strong&gt;(NHibernate.Transaction.ITransactionFactory)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for &lt;i&gt;ITransaction&lt;/i&gt; instances. Not exposed to the application, but can be extended/implemented by the developer. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Given a &amp;quot;lite&amp;quot; architecture, the application bypasses the &lt;i&gt;ITransaction&lt;/i&gt;, &lt;i&gt;ITransactionFactory&lt;/i&gt; and/or &lt;i&gt;IConnectionProvider&lt;/i&gt; APIs to talk to ADO.NET directly. 
&lt;/p&gt;</description></item><item><title>Architecture</title><link>http://nhforge.org/wikis/reference2-0en/architecture/revision/6.aspx</link><pubDate>Fri, 05 Sep 2008 23:28:53 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:27</guid><dc:creator>Fabio Maulo</dc:creator><comments>http://nhforge.org/wikis/reference2-0en/architecture/comments.aspx</comments><description>Revision 6 posted to NHibernate 2.0  by Fabio Maulo on 05/09/2008 08:28:53 p.m.&lt;br /&gt;
&lt;h2&gt;Architecture&lt;/h2&gt;
&lt;h4&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;A (very) high-level view of the NHibernate architecture: 
&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img style="border:0;vertical-align:middle;margin-left:100px;margin-right:100px;" src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/overview.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img style="vertical-align:middle;margin-left:200px;margin-right:200px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/overview.png" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This diagram shows NHibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. 
&lt;/p&gt;
&lt;p&gt;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 &amp;quot;lite&amp;quot; architecture has the application provide its own ADO.NET connections and manage its own transactions. This approach uses a minimal subset of NHibernate&amp;#39;s APIs: 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif"&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif" border="0" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img style="margin-left:150px;margin-right:150px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/lite.png" alt="" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The &amp;quot;full cream&amp;quot; architecture abstracts the application away from the underlying ADO.NET APIs and lets NHibernate take care of the details. 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif"&gt;&lt;span style="text-decoration: line-through; color: red;"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif" border="0" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;span style="background: SpringGreen;"&gt;&lt;img style="margin-left:100px;margin-right:100px;" src="/cfs-file.ashx/__key/CommunityServer.Components.SiteFiles/wikis.NHReference/fullcream.png" alt="" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here some definitions of the objects in the diagrams: 
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ISessionFactory&lt;/strong&gt; (NHibernate.ISessionFactory)&lt;/p&gt;
&lt;p&gt;A threadsafe (immutable) cache of compiled mappings for a single database. A factory for &lt;i&gt;ISession&lt;/i&gt; and a client of &lt;i&gt;IConnectionProvider&lt;/i&gt;. Might hold an optional (second-level) cache of data that is reusable between transactions, at a process- or cluster-level. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ISession&lt;/strong&gt; (NHibernate.ISession)&lt;/p&gt;
&lt;p&gt;A single-threaded, short-lived object representing a conversation between the application and the persistent store. Wraps an ADO.NET connection. Factory for &lt;i&gt;ITransaction&lt;/i&gt;. Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier. 
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Persistent Objects and Collection&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;Short-lived, single threaded objects containing persistent state and business function. These might be ordinary POCOs, the only special thing about them is that they are currently associated with (exactly one) &lt;i&gt;ISession&lt;/i&gt;. As soon as the &lt;i&gt;Session&lt;/i&gt; 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). 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Transient Objects and Collections &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Instances of persistent classes that are not currently associated with a &lt;i&gt;ISession&lt;/i&gt;. They may have been instantiated by the application and not (yet) persisted or they may have been instantiated by a closed &lt;i&gt;ISession&lt;/i&gt;. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;ITransaction&lt;/strong&gt; (NHibernate.ITransaction)&lt;/p&gt;
&lt;p&gt;(Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. Abstracts application from underlying ADO.NET transaction. An &lt;i&gt;ISession&lt;/i&gt; might span several &lt;i&gt;ITransaction&lt;/i&gt;s in some cases. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IConnectionProvider &lt;/strong&gt;(NHibernate.Connection.IConnectionProvider)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for ADO.NET connections and commands. Abstracts application from the concrete vendor-specific implementations of &lt;i&gt;IDbConnection&lt;/i&gt; and &lt;i&gt;IDbCommand&lt;/i&gt;. Not exposed to application, but can be extended/implemented by the developer. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IDriver &lt;/strong&gt;(NHibernate.Driver.IDriver)&lt;/p&gt;
&lt;p&gt;(Optional) An interface encapsulating differences between ADO.NET providers, such as parameter naming conventions and supported ADO.NET features. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ITransactionFactory &lt;/strong&gt;(NHibernate.Transaction.ITransactionFactory)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for &lt;i&gt;ITransaction&lt;/i&gt; instances. Not exposed to the application, but can be extended/implemented by the developer. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Given a &amp;quot;lite&amp;quot; architecture, the application bypasses the &lt;i&gt;ITransaction&lt;/i&gt;, &lt;i&gt;ITransactionFactory&lt;/i&gt; and/or &lt;i&gt;IConnectionProvider&lt;/i&gt; APIs to talk to ADO.NET directly. 
&lt;/p&gt;</description></item><item><title>Architecture</title><link>http://nhforge.org/wikis/reference2-0en/architecture/revision/5.aspx</link><pubDate>Sun, 31 Aug 2008 23:25:03 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:26</guid><dc:creator>Fabio Maulo</dc:creator><comments>http://nhforge.org/wikis/reference2-0en/architecture/comments.aspx</comments><description>Revision 5 posted to NHibernate 2.0  by Fabio Maulo on 31/08/2008 08:25:03 p.m.&lt;br /&gt;
&lt;h2&gt;Architecture&lt;/h2&gt;
&lt;h4&gt;&lt;b&gt;Overview&lt;/b&gt;&lt;/h4&gt;
&lt;p&gt;A (very) high-level view of the NHibernate architecture: 
&lt;/p&gt;
&lt;p&gt;&lt;img style="border:0;vertical-align:middle;margin-left:100px;margin-right:100px;" src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/overview.jpg" border="0" alt="" /&gt; 
&lt;/p&gt;
&lt;p&gt;This diagram shows NHibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. 
&lt;/p&gt;
&lt;p&gt;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 &amp;quot;lite&amp;quot; architecture has the application provide its own ADO.NET connections and manage its own transactions. This approach uses a minimal subset of NHibernate&amp;#39;s APIs: 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif" border="0" alt="" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;The &amp;quot;full cream&amp;quot; architecture abstracts the application away from the underlying ADO.NET APIs and lets NHibernate take care of the details. 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif" border="0" alt="" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;Here some definitions of the objects in the diagrams: 
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ISessionFactory&lt;/b&gt; (NHibernate.ISessionFactory)&lt;/p&gt;
&lt;p&gt;A threadsafe (immutable) cache of compiled mappings for a single database. A factory for &lt;i&gt;ISession&lt;/i&gt; and a client of &lt;i&gt;IConnectionProvider&lt;/i&gt;. Might hold an optional (second-level) cache of data that is reusable between transactions, at a process- or cluster-level. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ISession&lt;/b&gt; (NHibernate.ISession)&lt;/p&gt;
&lt;p&gt;A single-threaded, short-lived object representing a conversation between the application and the persistent store. Wraps an ADO.NET connection. Factory for &lt;i&gt;ITransaction&lt;/i&gt;. Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier. 
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Persistent Objects and Collection&lt;/b&gt; &lt;/p&gt;
&lt;p&gt;Short-lived, single threaded objects containing persistent state and business function. These might be ordinary POCOs, the only special thing about them is that they are currently associated with (exactly one) &lt;i&gt;ISession&lt;/i&gt;. As soon as the &lt;i&gt;Session&lt;/i&gt; 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). 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Transient Objects and Collections &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Instances of persistent classes that are not currently associated with a &lt;i&gt;ISession&lt;/i&gt;. They may have been instantiated by the application and not (yet) persisted or they may have been instantiated by a closed &lt;i&gt;ISession&lt;/i&gt;. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;ITransaction&lt;/b&gt; (NHibernate.ITransaction)&lt;/p&gt;
&lt;p&gt;(Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. Abstracts application from underlying ADO.NET transaction. An &lt;i&gt;ISession&lt;/i&gt; might span several &lt;i&gt;ITransaction&lt;/i&gt;s in some cases. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;IConnectionProvider &lt;/b&gt;(NHibernate.Connection.IConnectionProvider)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for ADO.NET connections and commands. Abstracts application from the concrete vendor-specific implementations of &lt;i&gt;IDbConnection&lt;/i&gt; and &lt;i&gt;IDbCommand&lt;/i&gt;. Not exposed to application, but can be extended/implemented by the developer. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;IDriver &lt;/b&gt;(NHibernate.Driver.IDriver)&lt;/p&gt;
&lt;p&gt;(Optional) An interface encapsulating differences between ADO.NET providers, such as parameter naming conventions and supported ADO.NET features. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ITransactionFactory &lt;/b&gt;(NHibernate.Transaction.ITransactionFactory)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for &lt;i&gt;ITransaction&lt;/i&gt; instances. Not exposed to the application, but can be extended/implemented by the developer. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Given a &amp;quot;lite&amp;quot; architecture, the application bypasses the &lt;i&gt;ITransaction&lt;/i&gt;, &lt;i&gt;ITransactionFactory&lt;/i&gt; and/or &lt;i&gt;IConnectionProvider&lt;/i&gt; APIs to talk to ADO.NET directly. 
&lt;/p&gt;</description></item><item><title>Architecture</title><link>http://nhforge.org/wikis/reference2-0en/architecture/revision/4.aspx</link><pubDate>Sun, 31 Aug 2008 23:25:03 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:16</guid><dc:creator>Fabio Maulo</dc:creator><comments>http://nhforge.org/wikis/reference2-0en/architecture/comments.aspx</comments><description>Revision 4 posted to NHibernate 2.0  by Fabio Maulo on 31/08/2008 08:25:03 p.m.&lt;br /&gt;
&lt;h2&gt;Architecture&lt;/h2&gt;
&lt;h4&gt;&lt;b&gt;Overview&lt;/b&gt;&lt;/h4&gt;
&lt;p&gt;A (very) high-level view of the NHibernate architecture: 
&lt;/p&gt;
&lt;p&gt;&lt;img style="border:0;vertical-align:middle;margin-left:100px;margin-right:100px;" src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/overview.jpg" border="0" alt="" /&gt; 
&lt;/p&gt;
&lt;p&gt;This diagram shows NHibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. 
&lt;/p&gt;
&lt;p&gt;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 &amp;quot;lite&amp;quot; architecture has the application provide its own ADO.NET connections and manage its own transactions. This approach uses a minimal subset of NHibernate&amp;#39;s APIs: 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif" border="0" alt="" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;The &amp;quot;full cream&amp;quot; architecture abstracts the application away from the underlying ADO.NET APIs and lets NHibernate take care of the details. 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif" border="0" alt="" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;Here some definitions of the objects in the diagrams: 
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ISessionFactory&lt;/b&gt; (NHibernate.ISessionFactory)&lt;/p&gt;
&lt;p&gt;A threadsafe (immutable) cache of compiled mappings for a single database. A factory for &lt;i&gt;ISession&lt;/i&gt; and a client of &lt;i&gt;IConnectionProvider&lt;/i&gt;. Might hold an optional (second-level) cache of data that is reusable between transactions, at a process- or cluster-level. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ISession&lt;/b&gt; (NHibernate.ISession)&lt;/p&gt;
&lt;p&gt;A single-threaded, short-lived object representing a conversation between the application and the persistent store. Wraps an ADO.NET connection. Factory for &lt;i&gt;ITransaction&lt;/i&gt;. Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier. 
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Persistent Objects and Collection&lt;/b&gt; &lt;/p&gt;
&lt;p&gt;Short-lived, single threaded objects containing persistent state and business function. These might be ordinary POCOs, the only special thing about them is that they are currently associated with (exactly one) &lt;i&gt;ISession&lt;/i&gt;. As soon as the &lt;i&gt;Session&lt;/i&gt; 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). 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Transient Objects and Collections &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Instances of persistent classes that are not currently associated with a &lt;i&gt;ISession&lt;/i&gt;. They may have been instantiated by the application and not (yet) persisted or they may have been instantiated by a closed &lt;i&gt;ISession&lt;/i&gt;. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;ITransaction&lt;/b&gt; (NHibernate.ITransaction)&lt;/p&gt;
&lt;p&gt;(Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. Abstracts application from underlying ADO.NET transaction. An &lt;i&gt;ISession&lt;/i&gt; might span several &lt;i&gt;ITransaction&lt;/i&gt;s in some cases. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;IConnectionProvider &lt;/b&gt;(NHibernate.Connection.IConnectionProvider)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for ADO.NET connections and commands. Abstracts application from the concrete vendor-specific implementations of &lt;i&gt;IDbConnection&lt;/i&gt; and &lt;i&gt;IDbCommand&lt;/i&gt;. Not exposed to application, but can be extended/implemented by the developer. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;IDriver &lt;/b&gt;(NHibernate.Driver.IDriver)&lt;/p&gt;
&lt;p&gt;(Optional) An interface encapsulating differences between ADO.NET providers, such as parameter naming conventions and supported ADO.NET features. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ITransactionFactory &lt;/b&gt;(NHibernate.Transaction.ITransactionFactory)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for &lt;i&gt;ITransaction&lt;/i&gt; instances. Not exposed to the application, but can be extended/implemented by the developer. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Given a &amp;quot;lite&amp;quot; architecture, the application bypasses the &lt;i&gt;ITransaction&lt;/i&gt;, &lt;i&gt;ITransactionFactory&lt;/i&gt; and/or &lt;i&gt;IConnectionProvider&lt;/i&gt; APIs to talk to ADO.NET directly. 
&lt;/p&gt;</description></item><item><title>Architecture</title><link>http://nhforge.org/wikis/reference2-0en/architecture/revision/3.aspx</link><pubDate>Sun, 31 Aug 2008 23:25:03 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:15</guid><dc:creator>Fabio Maulo</dc:creator><comments>http://nhforge.org/wikis/reference2-0en/architecture/comments.aspx</comments><description>Revision 3 posted to NHibernate 2.0  by Fabio Maulo on 31/08/2008 08:25:03 p.m.&lt;br /&gt;
&lt;h2&gt;Architecture&lt;/h2&gt;
&lt;h4&gt;&lt;b&gt;Overview&lt;/b&gt;&lt;/h4&gt;
&lt;p&gt;A (very) high-level view of the NHibernate architecture: 
&lt;/p&gt;
&lt;p&gt;&lt;img style="border:0;vertical-align:middle;margin-left:100px;margin-right:100px;" src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/overview.jpg" border="0" alt="" /&gt; 
&lt;/p&gt;
&lt;p&gt;This diagram shows NHibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. 
&lt;/p&gt;
&lt;p&gt;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 &amp;quot;lite&amp;quot; architecture has the application provide its own ADO.NET connections and manage its own transactions. This approach uses a minimal subset of NHibernate&amp;#39;s APIs: 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif" border="0" alt="" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;The &amp;quot;full cream&amp;quot; architecture abstracts the application away from the underlying ADO.NET APIs and lets NHibernate take care of the details. 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif" border="0" alt="" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;Here some definitions of the objects in the diagrams: 
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ISessionFactory&lt;/b&gt; (NHibernate.ISessionFactory)&lt;/p&gt;
&lt;p&gt;A threadsafe (immutable) cache of compiled mappings for a single database. A factory for &lt;i&gt;ISession&lt;/i&gt; and a client of &lt;i&gt;IConnectionProvider&lt;/i&gt;. Might hold an optional (second-level) cache of data that is reusable between transactions, at a process- or cluster-level. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ISession&lt;/b&gt; (NHibernate.ISession)&lt;/p&gt;
&lt;p&gt;A single-threaded, short-lived object representing a conversation between the application and the persistent store. Wraps an ADO.NET connection. Factory for &lt;i&gt;ITransaction&lt;/i&gt;. Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier. 
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Persistent Objects and Collection&lt;/b&gt; &lt;/p&gt;
&lt;p&gt;Short-lived, single threaded objects containing persistent state and business function. These might be ordinary POCOs, the only special thing about them is that they are currently associated with (exactly one) &lt;i&gt;ISession&lt;/i&gt;. As soon as the &lt;i&gt;Session&lt;/i&gt; 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). 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Transient Objects and Collections &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Instances of persistent classes that are not currently associated with a &lt;i&gt;ISession&lt;/i&gt;. They may have been instantiated by the application and not (yet) persisted or they may have been instantiated by a closed &lt;i&gt;ISession&lt;/i&gt;. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;ITransaction&lt;/b&gt; (NHibernate.ITransaction)&lt;/p&gt;
&lt;p&gt;(Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. Abstracts application from underlying ADO.NET transaction. An &lt;i&gt;ISession&lt;/i&gt; might span several &lt;i&gt;ITransaction&lt;/i&gt;s in some cases. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;IConnectionProvider &lt;/b&gt;(NHibernate.Connection.IConnectionProvider)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for ADO.NET connections and commands. Abstracts application from the concrete vendor-specific implementations of &lt;i&gt;IDbConnection&lt;/i&gt; and &lt;i&gt;IDbCommand&lt;/i&gt;. Not exposed to application, but can be extended/implemented by the developer. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;IDriver &lt;/b&gt;(NHibernate.Driver.IDriver)&lt;/p&gt;
&lt;p&gt;(Optional) An interface encapsulating differences between ADO.NET providers, such as parameter naming conventions and supported ADO.NET features. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ITransactionFactory &lt;/b&gt;(NHibernate.Transaction.ITransactionFactory)&lt;/p&gt;
&lt;p&gt;(Optional) A factory for &lt;i&gt;ITransaction&lt;/i&gt; instances. Not exposed to the application, but can be extended/implemented by the developer. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Given a &amp;quot;lite&amp;quot; architecture, the application bypasses the &lt;i&gt;ITransaction&lt;/i&gt;, &lt;i&gt;ITransactionFactory&lt;/i&gt; and/or &lt;i&gt;IConnectionProvider&lt;/i&gt; APIs to talk to ADO.NET directly. 
&lt;/p&gt;</description></item><item><title>Architecture</title><link>http://nhforge.org/wikis/reference2-0en/architecture/revision/2.aspx</link><pubDate>Sun, 31 Aug 2008 23:24:38 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:6</guid><dc:creator>Fabio Maulo</dc:creator><comments>http://nhforge.org/wikis/reference2-0en/architecture/comments.aspx</comments><description>Revision 2 posted to NHibernate 2.0  by Fabio Maulo on 31/08/2008 08:24:38 p.m.&lt;br /&gt;
&lt;h2&gt;Architecture&lt;/h2&gt;
&lt;h4&gt;&lt;b&gt;Overview&lt;/b&gt;&lt;/h4&gt;
&lt;p&gt;A (very) high-level view of the NHibernate architecture: 
&lt;/p&gt;
&lt;p&gt;&lt;img style="border:0;vertical-align:middle;margin-left:100px;margin-right:100px;" src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/overview.jpg" border="0" alt="" /&gt; 
&lt;/p&gt;
&lt;p&gt;This diagram shows NHibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. 
&lt;/p&gt;
&lt;p&gt;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 &amp;quot;lite&amp;quot; architecture has the application provide its own ADO.NET connections and manage its own transactions. This approach uses a minimal subset of NHibernate&amp;#39;s APIs: 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif" border="0" alt="" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;The &amp;quot;full cream&amp;quot; architecture abstracts the application away from the underlying ADO.NET APIs and lets NHibernate take care of the details. 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif" border="0" alt="" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;Here some definitions of the objects in the diagrams: 
&lt;/p&gt;
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;dl&amp;gt;&lt;/span&gt;
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;dt&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ISessionFactory&lt;/b&gt; (&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;NHibernate.ISessionFactory&amp;lt;/tt&amp;gt;)&lt;/span&gt; 
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&lt;/span&gt;
&lt;span style="background: SpringGreen;"&gt;NHibernate.ISessionFactory)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;A threadsafe (immutable) cache of compiled mappings for a single database. A factory for &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;ISession&amp;lt;/tt&amp;gt;&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;ISession&lt;/span&gt;&lt;/i&gt; and a client of &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;IConnectionProvider&amp;lt;/tt&amp;gt;.&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;IConnectionProvider&lt;/span&gt;&lt;/i&gt;&lt;span style="background: SpringGreen;"&gt;.&lt;/span&gt; Might hold an optional (second-level) cache of data that is reusable between transactions, at a process- or cluster-level. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ISession&lt;/b&gt; (&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;NHibernate.ISession&amp;lt;/tt&amp;gt;)&lt;/span&gt; 
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&lt;/span&gt;
&lt;span style="background: SpringGreen;"&gt;NHibernate.ISession)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;A single-threaded, short-lived object representing a conversation between the application and the persistent store. Wraps an ADO.NET connection. Factory for &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;ITransaction&amp;lt;/tt&amp;gt;.&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;ITransaction&lt;/span&gt;&lt;/i&gt;&lt;span style="background: SpringGreen;"&gt;.&lt;/span&gt; Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Persistent Objects and &lt;span style="text-decoration: line-through; color: red;"&gt;Collections&lt;/span&gt;&lt;/b&gt; 
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&lt;/span&gt;
&lt;span style="background: SpringGreen;"&gt;Collection&lt;/span&gt;&lt;/b&gt; &lt;/p&gt;
&lt;p&gt;Short-lived, single threaded objects containing persistent state and business function. These might be ordinary POCOs, the only special thing about them is that they are currently associated with (exactly one) &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;ISession&amp;lt;/tt&amp;gt;.&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;ISession&lt;/span&gt;&lt;/i&gt;&lt;span style="background: SpringGreen;"&gt;.&lt;/span&gt; As soon as the &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;Session&amp;lt;/tt&amp;gt;&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;Session&lt;/span&gt;&lt;/i&gt; 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). 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Transient Objects and Collections &lt;/b&gt;
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&lt;/span&gt;
&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Instances of persistent classes that are not currently associated with a &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;ISession&amp;lt;/tt&amp;gt;.&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;ISession&lt;/span&gt;&lt;/i&gt;&lt;span style="background: SpringGreen;"&gt;.&lt;/span&gt; They may have been instantiated by the application and not (yet) persisted or they may have been instantiated by a closed &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;ISession&amp;lt;/tt&amp;gt;.&lt;/span&gt; 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;/span&gt;&lt;i&gt;&lt;span style="background: SpringGreen;"&gt;ISession&lt;/span&gt;&lt;/i&gt;&lt;span style="background: SpringGreen;"&gt;.&lt;/span&gt; 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;ITransaction&lt;/b&gt; (&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;NHibernate.ITransaction&amp;lt;/tt&amp;gt;)&lt;/span&gt; 
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&lt;/span&gt;
&lt;span style="background: SpringGreen;"&gt;NHibernate.ITransaction)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;(Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. Abstracts application from underlying ADO.NET transaction. An &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;ISession&amp;lt;/tt&amp;gt;&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;ISession&lt;/span&gt;&lt;/i&gt; might span several &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;ITransaction&amp;lt;/tt&amp;gt;s&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;ITransaction&lt;/span&gt;&lt;/i&gt;&lt;span style="background: SpringGreen;"&gt;s&lt;/span&gt; in some cases. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;IConnectionProvider &lt;/b&gt;(&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;NHibernate.Connection.IConnectionProvider&amp;lt;/tt&amp;gt;)&lt;/span&gt; 
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&lt;/span&gt;
&lt;span style="background: SpringGreen;"&gt;NHibernate.Connection.IConnectionProvider)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;(Optional) A factory for ADO.NET connections and commands. Abstracts application from the concrete vendor-specific implementations of &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;IDbConnection&amp;lt;/tt&amp;gt;&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;IDbConnection&lt;/span&gt;&lt;/i&gt; and &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;IDbCommand&amp;lt;/tt&amp;gt;.&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;IDbCommand&lt;/span&gt;&lt;/i&gt;&lt;span style="background: SpringGreen;"&gt;.&lt;/span&gt; Not exposed to application, but can be extended/implemented by the developer. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;IDriver &lt;/b&gt;(&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;NHibernate.Driver.IDriver&amp;lt;/tt&amp;gt;)&lt;/span&gt; 
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&lt;/span&gt;
&lt;span style="background: SpringGreen;"&gt;NHibernate.Driver.IDriver)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;(Optional) An interface encapsulating differences between ADO.NET providers, such as parameter naming conventions and supported ADO.NET features. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;ITransactionFactory &lt;/b&gt;(&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;NHibernate.Transaction.ITransactionFactory&amp;lt;/tt&amp;gt;)&lt;/span&gt; 
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&lt;/span&gt;
&lt;span style="background: SpringGreen;"&gt;NHibernate.Transaction.ITransactionFactory)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;(Optional) A factory for &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;ITransaction&amp;lt;/tt&amp;gt;&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;ITransaction&lt;/span&gt;&lt;/i&gt; instances. Not exposed to the application, but can be extended/implemented by the developer. &lt;/p&gt;
&lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;/dd&amp;gt;&amp;lt;/dl&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Given a &amp;quot;lite&amp;quot; architecture, the application bypasses the &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;ITransaction&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;ITransactionFactory&amp;lt;/tt&amp;gt;&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;ITransaction&lt;/span&gt;&lt;/i&gt;&lt;span style="background: SpringGreen;"&gt;,&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;ITransactionFactory&lt;/span&gt;&lt;/i&gt; and/or &lt;span style="text-decoration: line-through; color: red;"&gt;&amp;lt;tt&amp;gt;IConnectionProvider&amp;lt;/tt&amp;gt;&lt;/span&gt; &lt;i&gt;&lt;span style="background: SpringGreen;"&gt;IConnectionProvider&lt;/span&gt;&lt;/i&gt; APIs to talk to ADO.NET directly. 
&lt;/p&gt;
&lt;h4&gt;&amp;nbsp;&lt;/h4&gt;
&lt;p style="font-family:arial,sans-serif;"&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Architecture</title><link>http://nhforge.org/wikis/reference2-0en/architecture/revision/1.aspx</link><pubDate>Sun, 31 Aug 2008 23:18:37 GMT</pubDate><guid isPermaLink="false">45f813f2-f1c4-4eda-a619-288e3cadc793:5</guid><dc:creator>Fabio Maulo</dc:creator><comments>http://nhforge.org/wikis/reference2-0en/architecture/comments.aspx</comments><description>Revision 1 posted to NHibernate 2.0  by Fabio Maulo on 31/08/2008 08:18:37 p.m.&lt;br /&gt;
&lt;h4&gt;&lt;b&gt;Overview&lt;/b&gt;&lt;/h4&gt;
&lt;p&gt;A (very) high-level view of the NHibernate architecture: 
&lt;/p&gt;
&lt;p&gt;&lt;img style="border:0;vertical-align:middle;margin-left:100px;margin-right:100px;" src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/overview.jpg" border="0" alt="" /&gt; 
&lt;/p&gt;
&lt;p&gt;This diagram shows NHibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. 
&lt;/p&gt;
&lt;p&gt;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 &amp;quot;lite&amp;quot; architecture has the application provide its own ADO.NET connections and manage its own transactions. This approach uses a minimal subset of NHibernate&amp;#39;s APIs: 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/lite.gif" border="0" alt="" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;The &amp;quot;full cream&amp;quot; architecture abstracts the application away from the underlying ADO.NET APIs and lets NHibernate take care of the details. 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif"&gt;&lt;img src="http://knol.google.com/k/-/-/1nr4enxv3dpeq/jd6roh/fullcream.gif" border="0" alt="" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;Here some definitions of the objects in the diagrams: 
&lt;/p&gt;
&amp;lt;dl&amp;gt;
&amp;lt;dt&amp;gt;&lt;b&gt;ISessionFactory&lt;/b&gt; (&amp;lt;tt&amp;gt;NHibernate.ISessionFactory&amp;lt;/tt&amp;gt;) 
&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;
&lt;p&gt;A threadsafe (immutable) cache of compiled mappings for a single database. A factory for &amp;lt;tt&amp;gt;ISession&amp;lt;/tt&amp;gt; and a client of &amp;lt;tt&amp;gt;IConnectionProvider&amp;lt;/tt&amp;gt;. Might hold an optional (second-level) cache of data that is reusable between transactions, at a process- or cluster-level. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;b&gt;ISession&lt;/b&gt; (&amp;lt;tt&amp;gt;NHibernate.ISession&amp;lt;/tt&amp;gt;) 
&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;
&lt;p&gt;A single-threaded, short-lived object representing a conversation between the application and the persistent store. Wraps an ADO.NET connection. Factory for &amp;lt;tt&amp;gt;ITransaction&amp;lt;/tt&amp;gt;. Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;b&gt;Persistent Objects and Collections&lt;/b&gt; 
&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;
&lt;p&gt;Short-lived, single threaded objects containing persistent state and business function. These might be ordinary POCOs, the only special thing about them is that they are currently associated with (exactly one) &amp;lt;tt&amp;gt;ISession&amp;lt;/tt&amp;gt;. As soon as the &amp;lt;tt&amp;gt;Session&amp;lt;/tt&amp;gt; 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). 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;b&gt;Transient Objects and Collections &lt;/b&gt;
&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;
&lt;p&gt;Instances of persistent classes that are not currently associated with a &amp;lt;tt&amp;gt;ISession&amp;lt;/tt&amp;gt;. They may have been instantiated by the application and not (yet) persisted or they may have been instantiated by a closed &amp;lt;tt&amp;gt;ISession&amp;lt;/tt&amp;gt;. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;b&gt;ITransaction&lt;/b&gt; (&amp;lt;tt&amp;gt;NHibernate.ITransaction&amp;lt;/tt&amp;gt;) 
&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;
&lt;p&gt;(Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. Abstracts application from underlying ADO.NET transaction. An &amp;lt;tt&amp;gt;ISession&amp;lt;/tt&amp;gt; might span several &amp;lt;tt&amp;gt;ITransaction&amp;lt;/tt&amp;gt;s in some cases. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;b&gt;IConnectionProvider &lt;/b&gt;(&amp;lt;tt&amp;gt;NHibernate.Connection.IConnectionProvider&amp;lt;/tt&amp;gt;) 
&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;
&lt;p&gt;(Optional) A factory for ADO.NET connections and commands. Abstracts application from the concrete vendor-specific implementations of &amp;lt;tt&amp;gt;IDbConnection&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;IDbCommand&amp;lt;/tt&amp;gt;. Not exposed to application, but can be extended/implemented by the developer. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;b&gt;IDriver &lt;/b&gt;(&amp;lt;tt&amp;gt;NHibernate.Driver.IDriver&amp;lt;/tt&amp;gt;) 
&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;
&lt;p&gt;(Optional) An interface encapsulating differences between ADO.NET providers, such as parameter naming conventions and supported ADO.NET features. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&amp;lt;/dd&amp;gt;&amp;lt;dt&amp;gt;&lt;b&gt;ITransactionFactory &lt;/b&gt;(&amp;lt;tt&amp;gt;NHibernate.Transaction.ITransactionFactory&amp;lt;/tt&amp;gt;) 
&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;
&lt;p&gt;(Optional) A factory for &amp;lt;tt&amp;gt;ITransaction&amp;lt;/tt&amp;gt; instances. Not exposed to the application, but can be extended/implemented by the developer. &lt;/p&gt;
&amp;lt;/dd&amp;gt;&amp;lt;/dl&amp;gt;
&lt;p&gt;Given a &amp;quot;lite&amp;quot; architecture, the application bypasses the &amp;lt;tt&amp;gt;ITransaction&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;ITransactionFactory&amp;lt;/tt&amp;gt; and/or &amp;lt;tt&amp;gt;IConnectionProvider&amp;lt;/tt&amp;gt; APIs to talk to ADO.NET directly. 
&lt;/p&gt;
&lt;h4&gt;&amp;nbsp;&lt;/h4&gt;
&lt;p style="font-family:arial,sans-serif;"&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>
