2006-6-17

xiaoxiao2021-04-01  206

SmallTalk, the earliest object-oriented programming language, provides developers with a rapid development of an object-oriented system. Classic Model, View, Controller (MVC) design mode is developed from this research and is still used as a reference model. Model Save, View Displays the data controlled by Controller. View is responsible for sending output to users, and Controller is responsible for reacting user actions and updating Model accordingly.

ASP.NET provides a very good environment for achieving this classic design pattern. Developers implement View by developing user interfaces in the ASPX page. The Controller feature is implemented in the Code-BEHIND file (foo.aspx.vb or foo.aspx.cs).

This design is implemented in .NET provides a two-layer system, there is a significant advantage over the classic ASP structure. Separating the user display from the operation (Controller) to improve the reuse of the code. Data (Model) is separated from the ATROLLLER to make you design a system that stored data with the background.

If the design is correct, a system based on MVC design mode will not know that it is not concerned with the data provided to the MODEL component is stored in the SQL Server or the Oracle database or stored in a set of XML documents.

Many people will say that developers can easily implement this mode using the ASP page and COM objects. But the fact is that most systems I check don't use COM objects at all, or just use COM objects to access the database; they are still embedded in the ASP page to complete business logic. I am not saying that the MVC mode advocates that there is no script in the ASP page. I just say that the script in the ASP page should only be limited to supporting the View function and the Controller feature.

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

New Post(0)