When we open the portal site, we often see a lot of tightly arranged channels list, such as "News", "Finance", "entertainment" and so on. The channel provides convenient navigation function for the website.
Knowledge Preparation
Each of the schema scenarios mentioned in this article is based on the MVC (Model-view-controller) pattern, which provides a brief description of each component in the pattern:
Model: Contains business logic operations and data access operations
View: Contains UI processing related actions
Controller: Control and coordinate the process of view and model
Comparison of the programmes
scheme |
schema description |
code reusability |
development mode |
deployment way |
|
|
|
module is more concentrated, the development is quicker, but it is not suitable for large-scale collaborative development. |
modules are more centralized and easier to deploy, but a small bug can cause the entire site to be paralyzed. |
scenario two |
> Create a web P for each channel Roject. The model parts for each channel can be included in the corresponding Web project or encapsulated into the class Library. |
Each model part is applied to a specific channel, the code is decentralized and reusability is low. |
|
modules are independent, deployment is very complex, but because the channels are loosely coupled (and can even be located on different servers), a channel failure will not affect the normal operation of other channels. |
scheme three |
> Create a web P for each channel Roject. The model part of all channels is packaged into a shared class Library. |
All channels share a model part, the code is more centralized, with high reusability. The |
|
modules are independent, deployment is more complex, but because each channel is loosely coupled (and can even be located on different servers), a channel failure will not affect the normal operation of other channels. |
Summarize
Based on the foregoing analysis, we can generally draw the following conclusions:
Project one: The development of fast, convenient deployment, suitable for the business function of a relatively simple small web site;
Scheme II: More defects, not recommended;
Project three: Each module loose coupling, code reusability is good, suitable for large-scale collaborative development, suitable for the business function more complex medium and large web site.
About Model Parts
The model part encapsulates all business logic operations and data access operations, which may include object entity classes, object manipulation classes, data access classes, and so on. In addition, the author strongly recommends that the object entity class, object operation class and data access class can be merged into one business logic class for small and medium application system, which can greatly improve the development and maintenance efficiency.