In ASP.NET, the patterns for the view and controller are not well defined. The model is left to the developer to design, views and controls can be created in a variety of ways.

Model
DataSets are the most common use of the model in .Net projects. A typed DataSet allows one to create an entity specific model.

View
The ASPX and ASCX files generally handle the responsibilities of the view, although it can also come from compiled server controls. With this pattern, the view object inherits from the controller object. This is different from the Smalltalk implementation, in which separate classes have pointers to one another.

Controllers
The duties of the controller are split between two places. The generation and passing of events is part of the framework and more specifically the Page and Control classes. The handling of events is usually done in the code-behind class. However, moving code specific to the transition between views in a separate Controller is a good practice. In turn, it becomes possible to centralize the registration of Observers in the isolated Controller.

Advertisements