Practice ORM, create a GROVE-based .NET application (4)
Writing Lin Xuepeng cnlxp@msn.com
Operation This relationship map entity class, simple example:
IOBJECTOPERATOR OO = ObjectoperatorFactory.getObjectoperator ();
IOBJECTQUERY OQ = OO.NEWQUERY (TypeOf (CustomersReranceQuery);
oq.Filter = "this.customername = 'setup software'";
oq.execute (result);
Current Grove supports multi-table relationship queries, including intervals Left Join, Right Join, Full Join, and the default Inner Join.
Support child query IN, simple example:
IOBJECTOPERATOR OO = ObjectoperatorFactory.getObjectoperator ();
IOBJECTQUERY OQ = OO.NEWQUERY (TypeOf (address));
oq.filter = "Customer.customerid.contains";
Oq.DeclareCollection ("Customer.customerid", "Customer.customerid> 1000");
Result = oq.execute (TypeOf (Customer));
Description: The SQL form represented by the above query is SELECT * from Addresses Where Customerid in (Select Customerid from Customers Where Customers.customerid> 1000)
14) Grove Help (CHM Format) Based on XML Description, Grove Help You can get or perform Toolbar's help buttons from the GroveKit installation directory.
Three-layer architecture principle
The relationship between the layers is that the data representation is responsible for encapsulation data. As the calling parameters of the data access layer, the result is returned; the business logic layer calls the result of the data access layer processing; the business logic layer and ASP.NET (generally an ASPX page Back class .aspx.cs) communication. The results of ASPX are obtained from commercial logic, and ASPX needs to do the operation of the business logic layer. For example, Customer is inserted, even in such a method in the data access layer, it cannot be directly called by ASPX. It must be packaged once in the commercial logic layer. The purpose of this is to make the structure simple and clear. The data access layer is only responsible for operating the database (essentially is operated by the Grove component). The business logic layer only does logic (obtaining the corresponding operation or returning data), processing the corresponding logic, and the data representation layer is only responsible for the package, or the parameter package of the ASPX page is incorporated into the business logic. The layer is handled accordingly, and the business logic layer is performed accordingly, and the data access layer is transferred to the substantial data operation.
Grove-based multi-layer development structure
Conclude
Through the above example, I believe that you have already grasped how to create a Grove-based .NET web application, including some methods of entity mapping classes, some definitions of the façade layer, and some reuse methods of the related DAO layers, these methods have been created. Your web application, the next step, you can test your program through the Microsoft Application Center Test.
Reference
About Grove's details, support sites have provided you with some related help
http://grove.91link.com
For object character modeling ORM, please refer to