The three-layer structure has also begun to blindly.

xiaoxiao2021-03-05  34

Some people in 9CBS have asked, I don't know what the three-layer structure is, or how to implement three-story architecture, so such as

In fact, regardless of the three layers, the four layers are also good, from the design needs (never the request of the boss, even if the customer needs)

Why is the C / S mode that is in B / S, and the shortcomings of the C / S mode will be except for the coding. In addition to the coding, BizLogic is dispersed in all customer terminals, and if you want to modify, it is very troublesome. Why is you also to SmartClient? Transition? This is because B / S mode puts all BizLogic on Server, and client resources are almost completely wasteful.

So, Bizlogic (the three-layer program is generally called BLL, business logic waiting) is a core problem. About the DAL (Data Access Layer) below BLL, and Uilayer above the BLL, it can be done by using C / S mode development. To: For example, an independent server is used to encapsulate database operations..

The three-layer structure of the three-layer structure is not to divide the project into DAL, BLL, and WebUI is called three floors, the following questions

In your project: 1. Uilayer only has a small amount (or no) SQL statement or stored procedure call, and these statements do not modify data? 2. If you take Uilayer, your project can be in Interface / API Do you provide all the features at the level? 3. Does your DAL can be ported to other similar environments? 4. Do you run in different servers separately?

If not all the answers are Yes, then your project is still not a three-layer program in strict sense. The three-layer program has some rules that need to be approved:

1. The most critical, the UI layer can only be used as a housing, which cannot contain any BizLogic processing. 2. Starting from the BLL, not the UI, the BLL layer should implement all BizLogic on the API, to object-oriented 3. Regardless of whether the data layer is a simple SQLHELPER, or the mapping Classes is also good, should do system-independent at a certain degree of abstraction 4. Regardless of using COM (Enterprise Service), or Remoting, or WebService The remote object technology of the class, whether it is really deployed to different servers, regardless of deployment, at least in design, but also to consider multiple servers through load balancing

Therefore, consider a project that should apply three-layer / multi-layer design. Do you really need? In fact, most of the programs will open a WebApplication is enough, but there is no need to make such a complexity. More layers Structure is used to solve real complex project needs.

Don't blindly open the horse multi-layer program design, advanced is not necessarily good. ASP despised by countless people is because of his simplicity, and it is still like Microsoft.com, dell.com such giant Site

转载请注明原文地址:https://www.9cbs.com/read-33498.html

New Post(0)