asp.net study notes
The first chapter web development foundation
What is the web
web-based work is hypertext information system.
Hypertext (hypertext): a global information structure
Hypermedia (hypertext): is the combination of multimedia information in a browsing environment
Hypertext Transfer Protocol (http): Hypertext Transfer Protocol over the Internet
B / S structure Introduction
Browser / server architecture, a client without developing the user interface, use a unified web browser makes a request to a web server, web server for processing the results returned to the client
C / S structure Introduction
The client / server model, the client need to install a proprietary software to communicate with the client
B / S and C / S Compare
B/S | C/S | |
---|---|---|
Development and maintenance costs | Development of low cost, low maintenance costs | High development costs, maintenance costs reflected in the high time to upgrade the software, you need to update all clients, use of the time required to install the client, while the b / s on the line just to have the browser |
Client load | Server-side load is heavy, the browser is only responsible for display | Heavy client load, the client will be responsible for processing and display |
safety | low | high |
Browser
Browser can access asp.net website, Google has major browsers, Firefox, etc.
html+css+js
Slightly (learned)
web three-tier system
Three-tier architecture refers to the entire business system is divided into the presentation layer, logic layer and data layer, which is conducive to development and maintenance and deployment. To achieve "high cohesion, low coupling"
Presentation Layer: is responsible for direct interaction with the user, generally refers to the system interface for display and data entry
Logical layers: a verification do some work, to better ensure the robustness running
Layer data: specifically for interacting with the database, perform CRUD operations all data objects referenced in this layer only.
MVC architecture
MVC architecture is a software development framework, which includes many design patterns, most closely observer (observer pattern), composite (combination mode), and strategy (Strategy Mode)
What is the mvc architecture
model (model) -view (view) -controller (controller)
MVC works
mvc application architecture of the input, processing and output forced apart, so that the software maintenance, extensible, and flexible. Model where all the logic code; view showing data displayed on the screen; the process controller provides control, he connecting role between the model and the view. Controller itself does not output any information and any treatment, he only responsible for the operation of the user request into the model, and invokes the appropriate view to display data after the process model.
model
Three members has the largest processing tasks. Independent models and data format, such a model can provide data for a plurality of views. Reducing repetitive code.
view
Users can see and interact with the interface in general is HTML, there are new, emerging technologies such as, flash, XHTML, xml / xsl .....
Controller
For receiving a user's request, and decides which model by processing, and then model the business logic used to handle user requests, and returns the data, the controller returns the last data format template corresponding view, the view presented to the user through.
Why mvc architecture
In asp.net aspx page by programmers developing user interfaces to implement the functions and logic functions of the view, the controller (implemented .cs), the model generally corresponding part of the business system. asp.net mvc model has the following features:
A plurality of views of a model
Using a plurality of controllers
When the model changes, all views automatically refresh
All controllers will work independently of each other
The advantages of the MVC architecture
Improve code reuse
Improve the maintainability of the program
Conducive to team development
MVC architecture of multiple modes
For example, a model of two views, a controller model and without changing the view, only need to add another view, and can be associated.
Similarly, a model, two views of two controllers.