Oo learning Summary: 1. System Software Architecture-generation of Layers

Source: Internet
Author: User

Analyze the structure of the petshop. Files at different layers can be quickly generated by using the codesmith generation function. For the template file, see Appendix 1: codesmith template file in the petshop architecture.

An automatic template is generated to obtain all the basic operations and obtain an object based on the primary key. You can also insert, delete, and update data. These basic operations are implemented in the template through two sets of code: stored procedure and SQL statement. The generated class structure is as follows:

 

 


The code is described as follows: only the most representative DAL layer is provided here. For other layers, see the PETSHOP architecture.

 


Note:

1. default SQL statement: used to complete the use of SQL statements. For example, some statements are used to build custom query conditions.

 

2. Parameter constants and paras configuration build parameters are not described here.

3. The basic operations generated by the system by default support SQL statements and stored procedures. It is implemented through reload in the system.

Use the SQL statement addition method.

 



The Stored Procedure Method adds a Boolean flag variable, which can be called as needed.

 


4. Support for custom query Conditions

If you need to customize the query, we recommend that you build an SQL string. It can receive the constructed SQL string passed through the upper layer.

By default, the system supports conditional queries using SQL statements and stored procedures. For example:

 



It must be noted that the common GetLDJQ0sbyCondition method is actually an encapsulation of GetLDJQ0sbyQueryString,

 



Note: The blue mark is used to call the above method.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.