Factory Class

Topic updated 10-10-2007

Every Table Template in a BO-Layer project generates one Factory Class. The Factory Class handles instances of the associated POCO Class generated by the same Table Template. The Factory Class simplifies important development tasks:

CRUD operations (Create - Read - Update - Delete) on POCO Class instances
Management of NHibernate Sessions (see Factory and Sessions) , controlled by Session Scope property
Database transactions (see Using transactions on the BO-Layer)

 

Configuration

The Table Template has a separate group of template options for the generated Factory Class.

FactoryClasses

 

Factory Class enhancement

Factory Classes can be enhanced in the following ways:

By adding custom code
By setting a base class (Factory Base Class option of the Table Template)

 

See also

The Filtering and sorting chapter explains how to

The Factory and Sessions chapter explains how the Factory Class handles NHibernate Sessions and database transactions.