|
Introduction Topic updated 15-5-2007 |
|
To create a BO-Layer using the NHibernate framework GenWise generates the following components:
For each Database Repository Entity: Business Objects NHibernate XML mapping files Factory Classes Custom Collection classes for each Business Object (Optional) Dataset / Datatable class
General for the Project: NHibernate Configuration Template that allows you to configure the NHibernate configuration Unit Testing Extension Template that allows you to add unit testing of your entire business object layer and to add your own tests. Application Configuration Template to configure settings via an app.config file. The power of the mapped Business Objects (BO) is that you can traverse the object relational tree in your code. The code fragment below gives an example of this. The business object for a customer with ID 12 is loaded and the orders of the customer are inspected:
Northwind.CustomersFactory _ncf = new Northwind.CustomersFactory() Customers c = _ncf.Fetch(12);
foreach (Order ord in c.Orders) { trace.Writeln(ord.order_no); }
We have made some modifications to the original NHibernate templates. NHibernate has been made part of the GenWise installation. It includes the Ms-access contribution developed at GenWise. If you want to download our modifications, you can download the source from the download section.
|