Briefly
Enterprise-level projects, initially did not think of how large http://www.php.cn/css/css-rwd-frameworks.html "target=" _blank "> framework, because the pressure will not be very big. So scalability has become a core requirement.
Traditional three-tier architecture. Application layer, business logic layer, data persistence layer. In view of the need to separate the server to reduce the pressure of the server, split into a Web server, Business Server, database server, and the three, especially the back and forth of the logical call of data logic, is the focus of my need to record.
Web
Front End app service, request API interface, get data rendering page.
1. Build the MVC framework and introduce public model and interface call class libraries.
2. Use the bootstrap framework to build a mobile-first front-end page frame.
3. Call back-end interfaces and render the page, depending on your business needs.
Web Api (logical service)
Build an HTTP-based stateless interface to handle web-side interaction requests. The following are key:
1. Under the condition of the interface stateless, judge the request permission level and corresponding legitimacy. (Rewrite the HTTP request, plus the legitimacy of the request, the class AOP facet judgment)
2. Provide or base a unified data model for smooth interaction between the front and back ends. (Entity's request and return model, build dependency reversal relationship.) Simplify the harmonization of request codes)
3. Access the database, perform the logical processing, and persist the data to the database.
SQL Server Database
Using Ibatis as an ORM framework, the efficiency of database interaction and the simplicity of code writing are used to improve freedom and extensibility.