[Translation] Chapter 1-an introduction to ASP. net mvc (1)

Source: Internet
Author: User
Tags time zones

Original article address: Chapter 1-an introduction to ASP. NET MVC

 


"Nothing except change is eternal .." -- Heraclitus

In this chapter, we provide you with a bird's eye view and Introduction to Microsoft ASP. net mvc framework. The goal of this chapter is to explain why you should use Microsoft ASP. net mvc to build your web application.

Since ASP. NET MVC
The framework is designed to allow you to write better software programs. The first part of this chapter will discuss the features that a good application should have. You can understand the software design principles and patterns to help you build software that can adapt to changes ..

Finally, we will discuss an ASP. NET
The architecture of the MVC application, and how the architecture helps you write better software programs. You will see an overview of different parts of the MVC application, including models, views, and controllers. You will also see an introduction to the sample program, this sample program will create an ASP. net
The MVC project is created.

A story with a moral

I still remember the day when the manager came to my office and asked me to build a simple button application. He explained that a simple dial-up management program is needed. When a health check is required, the dialing management program can notify relevant personnel through dialing. the dialing management program will load a list of phone numbers, when you click the button, the program will list the numbers in sequence. Is there anything simpler than this?

With confidence, I solemnly said that this dial-up management program will be completed that afternoon. I closed my office, put on my cowboy hat, started music, and started writing code. At the end of that day, I had completed that program. My manager was very happy. I was very happy to go home that night.
The work done in one day is perfect.

The next morning, my manager appeared at the door of my office. I am worried about whether there is a problem with the dialing management program,
He told me that the program works well. In fact, he liked it so much that he wanted to add another feature. He hopes that the dial-up management program will be able to call a number based on the actual survey results, so that the survey results can be stored in the database.

Based on my heroic spirit, I spent another day filling in the code. At the end of that day, I had updated the application and proudly presented the completed program to the manager.

I will not continue with this story, because anyone who makes a living by building software knows the end of this story. The story will never end. Once a software project starts, it is basically difficult to end it. Software programs need to constantly fill in new features, modify bugs, and improve performance.

When a software you create is required to be modified, you should consider it a compliment. Only useless software will be stuck. When people focus on software and the software is frequently used, it will undergo continuous changes.

Although I have already left that company (I am currently sitting in a Microsoft Office), I still have friends in that company and occasionally receive reports of program changes. Without question, the program has been transformed into a huge application that supports different time zones, complex call rules, and advanced report functions with tables. It cannot be said to be the original simple button application.

What is good software?

When web was just emerging, I dropped out of MIT to set up a new Internet company. In those days, it was very difficult to build a website. At that time, there was no ASP or ASP. net and other technologies (we only have a stone knife). At that time, the main task was to store HTML-formatted content in database tables. It was cool to make brilliant text.

When I first started writing software, the goal was to let the software do what I wanted. In early 1990s, competition began to become cruel. Adding the most features in the shortest time became the key to survival. For work, I often slept under the office desk.

In my initial stages, the software I defined has the following features:

Good software is something that can run according to your intention.

If I feel very ambitious, I will worry about performance, and if I have extra time, I will append one or two comments to the code. But the fact is that at the end of the day, my guidelines on job success are simple: Is the software working properly.

Over the past eight years, I have provided training and consulting to large companies and organizations, including Boeing, NASA, Lockheed Martin, and the National Science Foundation. A large organization is not a new company. In a large organization, the focus is not to build software applications as quickly as possible, but to build software applications that can be easily maintained.

Over the years, my definition of good software has changed in essence, because I have already faced the terrible situation of maintaining my own "giant thing, my definition of good software has been changed:

Good software is able to run according to your intentions and is easy to modify.

There are many reasons for changing the software over time. Michael feathers, in his book 《Working extends tively with legacy codeThe following reasons are provided:

1) You may need to add a new feature to the existing software.

2) You may need to modify a bug in the existing software.

3) You may need to optimize existing software.

4) You may need to improve the design of existing software.

For example, you may need to add a new feature. The call management application starts with a simple button application. However, more and more features are added to the program every day.

When you find a bug in the software, you also need to make changes to the software. For example, in the call management program, we find that the calculation of daytime time is incorrect (some people are awake in the morning !). We quickly changed the wrong code.

You may also need to modify the software to make it run faster. For some time, as business rules become very complex, it takes 12 seconds for the call management application to call a new phone number, we had to rewrite the code to reduce the time needed to obtain a new phone number to milliseconds.

Finally, you may need to modify the software to improve its design. In other words, you may need to find a poorly written code and replace it with good code. You may need to make your code more adaptable to changes.

Related Article

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.