Don't stay on the surface, MVC 3 We're going to go into some

Source: Internet
Author: User

In fact, there are only three components in MVC, model, View, Controller, which model is used as the business logic processing, Controller is responsible for the Model and view interaction, view is responsible for the page display.

This is a very simple structure, but there is very good extensibility in MVC, and we can implement our own framework structure or implementation by fully extending MVC. Simple use of MVC to implement some of the page's

The implementation is very easy, and does not require us to pay too much energy. But that doesn't really make us understand what MVC is? Why use MVC?

MVC is a very good framework, and its excellent program is even more advanced than the advent of Web forms, but we have a great effort to learn the Web form, the mastery of events will make us satisfied, but

There are no events in MVC, but also bring down the depth of our study, let's comb it together, learn about MVC we also need to do more in-depth study of the technical points.

  1. HtmlHelper and Urlhelper classes, which are the common classes or unique classes that we use for page display components in the view layer, but what do we know about it? We understand why we can use the HtmlHelper class? As we use extension methods, can we define some helper classes correctly to meet our own business needs, and how much do we understand about extension methods? Which of the several methods in the HtmlHelper class are we fully mastered?
  2. ActionResult This is the return type of action in the Controller, except, of course, the return type is void or other types, if I ask you, how many xxxresult in MVC inherit from ActionResult? Can you answer it accurately in a minute? If your answer is no, then what can we do, continue in depth, take more notes, and more memories?
  3. Filter this is one of the features I particularly like in MVC 3, especially when you add a global filter to play more beautiful. In MVC embedded in the 4 filter, whether you can say the specific name, whether you can not use smart hints, completely written out? Filter is an AOP aspect-oriented programming approach, and we can customize the filtering of various filters by inheriting from FilterAttribute and corresponding interfaces, have we used them? Is it possible to encode correctly the filter we need?
  4. Area I used to say in one of my blogs that this was a new feature in MVC 3, but there was a friend reply in MVC 2 that already existed, I looked for it, I didn't find an operation to add an area, and maybe I'm missing something on my computer and I'm not talking about it. Area is also called a region, we can define different function points in a complete application, such as the distinction between foreground and background? Area can easily distinguish between these two different function points, but we need to pay attention to some problems when we use area. Are there any answers you can answer at once? The first is to add a namespace to the registration route, and the other is that when we use HtmlHelper for page jumps, the area setting is also necessary?
  5. Viewengine view engine, said the good point is equivalent to the engine, is to drive our program to run the mechanism, then in MVC we can adopt the view engine has Webformviewengine and razorengine these two kinds, Of course, we can also use a third party to provide the view engine? So have we ever wondered if we can define our own view engine to drive our program's operation? If you say yes, then you are really Daniel, if it is no, then we should continue to go further.
  6. IOC inheritance we know that MVC provides a very flexible way to implement the IOC implementation, and we can implement the SOC separation of concerns through the IOC, what kind of IOC framework do we use? I am using AUTOFAC, and what if this framework is used in MVC to control the flexibility of the program? Of course, the IOC is implemented in a total of three kinds, constructors, attributes and another less common method of injection. Do we really have the flexibility to implement these frameworks in MVC? Keep trying.
  7. MVC's operating mechanism, we know that ASP. NET is a very complex framework, and MVC runs on this complex framework, so we know how controllers are activated in MVC. How does the action work? And why is it possible to define the same controller and action on different area after using area? Only by mastering the internal principles, can we cop, write more concise and more efficient code
  8. If you deploy MVC in IIS, if you do not refer to the tutorials on the web, just by your memory, can you correctly let the MVC program run correctly on IIS? I do not dare to say so, because I generally refer to the online tutorial to do.
  9. The value is passed in MVC, the model data is passed to the Controller,controller to pass the data to the view, or the view can get the data directly from the model, what is the argument for the transfer of the data? What should we do to avoid the procedural bugs that come with data transfer? A strong type would certainly be a sensible choice.
  10. Data validation is particularly humane in MVC, where it provides a number of features that can be validated on a field, and we can use or extend these features to validate the data for our pages. MVC provides a lot of data validation attribute, whether we can use it correctly, without causing various problems. I remember that if the field name is consistent with the ID in the view, then there is a hidden problem. Custom data validation, we extend our business logic.
  11. Razor syntax This is a newly added syntax structure in MVC 3, which we can use to complete our display of data in the view layer, but there are a lot of questions to note with the @ symbol. Can we think of it? The razor syntax itself is a very elegant grammatical structure.
  12. For exception handling, 404, 500 and other special errors of the page, log processing, performance optimization, program security considerations and so on these are we as programmers should grasp the knowledge, each knowledge point if we want to fully grasp, I am afraid we have to spend a lifetime in learning.

Learning is a very sacred thing, it brings the washing of our hearts, abandon impetuous, forever go deep, to find ourselves.

NET excerpt from http://www.cnblogs.com/jiagoushi/archive/2013/01/23/2872824.html

Don't stay on the surface, MVC 3 We're going to go into some

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.