How do I feel about the development sequence of Asp.net MVC in Agile development? First develop model? First develop Controller !)

Source: Internet
Author: User

Various ideas and sequences have been tried.

First, write the model. After all, the model is the foundation of everything, and there is no model. What should I do in the controller.

Later, I first wrote a view. The view is what the user can see. I don't know what the user is looking at, but how can I know what model the user should provide.

Write the Controller first.

Before discussing which order is the best, you must clarify the criteria for "good and bad.

Good development order and poor standards

1. Smooth

For example, it is not smooth to compile 10 methods of the model, then compile 10 methods of the controller, and then compile 10 views. From the agile perspective, it is a bad practice to start multiple stories at the same time and these stories can only be completed at the end.

First, compile a method in the controller, and then immediately upload the model that will be used for editing. When the data can be obtained (I use LINQ. Generally, the data content will be compiled in 3 minutes ), compile the view immediately, and then debug it smoothly. From the agile point of view, it is to start only one story and wait for it to end.

The best part of the latter is that there are only about 3 limited projects that can be compiled, debugged, tested, and delivered at the same time ~ Five files, with a very concentrated idea, are also very simple.

2. Do not do useless work

I remember writing classes in that year. Let alone create a bunch of Default constructors/parameter Constructors/"="/Destructors ...... In fact, half of them were never called.

Controller is the first thing that the user can perceive (some people think it is a view, but it is not because there is no Controller method, even if the aspx/cshtml address is entered, the view will not be displayed ), therefore, whether a model attribute or method will be used is stored in the ControllerCodeThe content that can be brought in is written as needed. If you don't need it, you can throw it to the other side.

During the time when we first wrote the model, we did leave a lot of useless model code. After writing the controller, there is basically no useless code.

So the correct order is: first write an action method, then define the model, and then bind the view according to the model; then the next action ......

On the whole, these two are the criteria for my current good and bad reviews,If the project/team is different, the standards may be different, so the optimal order will be different.. For more information, see.

 

Click to download the free agile development textbook: Martian agile development manual

 

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.