An example of a petshop-like n-layer framework based on nhib.pdf

Source: Internet
Author: User

This is a document material management module in a project. I split it into a separate solution, mainly to find a better framework system and data access method. In this way, I will do the project again, so I don't need to re-create the solution. I can simply add and modify classes on this framework...

This framework is basically based on petshop 4, and the project name has not been changed...

The online editor uses FCKeditor because it needs to be pasted directly from the Word document. Freetextbox was used in the past. Unfortunately, freetextbox free version does not support this function...

The encapsulated Nhibernate operation layer copies terrylee's three-layer structure application based on NhibernateProgramPreliminary development, and learned from other brothers in the gardenArticle. Thank you very much. I will continue to improve because of you...

After carefully considering the Microsoft enterprise database, strong-type datasets, nbear and nhib.pdf, we chose nhib.pdf. In fact, I am also very interested in nbear, and I almost used it. It is a pity that even if you follow the official document as an example, there are still many places that you do not understand, and errors will occur. The key is that there is no way to handle an error. The exception information cannot be found on Google... Therefore, we strongly urge nbear to add Chinese help documents...

The entire solution framework is divided into six layers: Bll logic processing layer, webui page presentation layer, idal data interface definition layer, sqlserverdal data access layer, model entity layer, and utility encapsulated nhib.pdf operation layer.

The bll layer processes some business logic, such as calculating some complex expressions, and then passing the data transmitted from the Dal to the page after determining whether the data is valid. Similarly, the value passed from the page must also be judged here to prevent exceptions from being thrown when invalid or wrong values are directly transferred to the data layer for running. Currently, this is only a simple call to the data access layer. The logic has not been added.

Idal is an interface that defines the methods required by the data access layer. The purpose of creating this layer is to set a rigid rule on the methods of the data access layer. Do not write the data access layer as you like. Even if the developer changes in the future, the successor only needs to check the idal to probably know what operations are performed on the database.

Model is an HBM ing file between the object class and nhib.pdf. Basically, a data table corresponds to an entity class and a ing file. Currently, nhibbench 1.2 is used. This version requires that all object classes must be declared as public virtual. The root node in the HBM file should also be declared as xmlns = "urn: nhibernate-mapping-2.2 ". These are two things to be aware of. At first, they suffered a lot.

Sqlserverdal implements idal database access methods, including addition, deletion, modification, and query. It calls the session created in nhib.pdf.

Utility is the encapsulated Nhibernate operation layer, creates a session factory, and CALLS methods such as Save and update of sessions.

Webui is a website project.

The business process is as follows:
Add document materials, fill in document material information, and determine whether a template exists when submitting the document. If no template exists, go to the template filling page. After entering the information, determine whether approval is required. If necessary, go to the Approval Information filling page. Save it without approval.

Dizzy, passed three timesCodeIt cannot be passed up. It's depressing to try again at 12 o'clock...

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.