Document directory
Original address: http://aspnet.codeplex.com/wikipage? Title = ASP. NET % 20mvc % 204% 20 Roadmap
This article is first published in the Turing community.
A year has passed, and it is time to release the new version of ASP. net mvc. This document covers the advanced roadmap of ASP. net mvc 4 framework.
We are in the early stage of ASP. net mvc 4 development, and this roadmap is the plan document for the next version. It is very important to understand this point. It is not a standard for new features. We hope to implement most or all of the features listed here, but it cannot be guaranteed. The plan may change. You can also help us change the plan! Visit the uservoice website to submit feedback, so that we can clearly know what content you want the new version to contain.
ASP. net mvc 4The Developer Preview version is ready for use!For more information about this version, visit ASP. net mvc 4.
Install through web platform Installer
- ASP. net mvc 4 for Visual Studio 2010
- ASP. net mvc 4 for Visual Studio 11 Developer Preview.
Or if you want to download the installer directly, you can visit the download details page.
Target
Before going into these recommended features, let's take a look at the overall goal of this version. Stand taller to see farther,Our goal isASP. NET MVCBecome the best building modern rich webApplication Platform.Therefore, we pay attention to the features in ASP. net mvc 4 (and the entire web stack), which makes us closer to this goal.
Topic
Before planning special features, the ASP. NET team developed topics to guide our plan. Some topics are not specific to ASP. net mvc, so they cannot be implemented independently in the ASP. net mvc feature group. We will work with people outside of Microsoft to achieve these goals.
- Development and deployment: make the development and deployment process simpler, better, and faster.
- The Platform: razor view engine and some new guides in ASP. net mvc 3 can also be used for ASP. NET web pages. We will continue to use the sharing feature of the entire web platform in ASP. net mvc.
- Ajax: whether adding ajax to an existing web application or implementing a complete single-page application (such as Gmail), we will all improve Ajax development in ASP. net mvc. We have some ideas, but now we are building an application to expose and understand bugs that can be fixed.
- HTML 5, tablets and mobile devices: by simply building an HTML 5 web application to build tablets and mobile applications, it has become an industry trend. HTML 5 applications provide the widest range of distribution options that can run on a wide variety of devices. However, writing application engines for mobile and tablet devices requires rich experience. We hope that building such an application will become easier.
- Cloud: it is easier to deploy and host web applications on the cloud (such as Windows azure. To benefit from the cloud, we will focus on performance, security, and scalability.
Features
Now, let's start to introduce the feature that you are most interested in! Note that some features are more plump than others.
Recipses (Task-based scalable tools)
Some tasks require you to operate on multiple parts of the application. For example, to add an Ajax grid to a view, you need to generate view code to present the HTML tag of the grid and create a data visualization class to display the grid, add the Controller class so that AJAX grids can obtain data through asynchronous calls.
ASP. net mvc 4 recipe is a dialog box released through nuget. It contains the relevant user interface and code used to automatically execute a special task. For example, implementing an oauth-based authentication is always much more complicated than calling a method, because it requires a lot of settings and a lot of UIS. The recipe that implements oauth authentication may provide a UI for you to set and then generate all the required code.
Example
The following are some ideas that can be implemented using recipe:
- Ajax Grid
- Implement oauth-based authentication
- Supports declarative authentication using Windows identity framework
Write, deploy, and install recipe
To write a recipe, you only need to implement a dialog box that uses the recipe API. This dialog box contains an MVC project interface instance, which is much easier to use than envdte. DTE (used to automate tasks in Visual Studio.
For example, to add a controller to an area of an ASP. net mvc project, you may need to call multiple methods to use DTE, while the recipe API only needs to call one method.
After compiling this dialog box, package it into a nuget package so that you can cook with your recipe (recipe.
Recipe Physical Model
The following physical model shows how recipe works. To start a recipe, right-click the project node in Solution Explorer (or in an appropriate file; some recipe is in the Context) and select Run recipe. This will open a menu with many recipe options available. (This may also be a sub menu of the context menu options of run recipes .)
The recipe installed with nuget is displayed in the list. Select and start a recipe. Different recipe have different UIS.
Recipe can be as simple as only one dialog box (either theoretically or not) or a wizard containing multiple steps. Click Finish to run the recipe with the specified settings.
Recipe API
For API, the idea is that the recipe developer can obtain the instance of the Project interface, which contains the context of how to start the recipe. It also provides a simple and easy-to-use fa C Ade on the MVC project system. Developers do not have to learn the DTE set of the entire interface. However, the interface can still access DTE to prevent the project interface from being insufficient.
Built-in recipe
As part of this project, we plan to build some built-in recipe. As mentioned above, oauth support, Ajax mesh, and WIF. We are also looking for other ideas.
Mobile support
Mobile devices (mobile phones and tablets) have become increasingly popular since they can browse websites. Therefore, to create a website for the public, you need to consider the experience that can be provided to visitors who use small screens or touch screens. In ASP. net mvc 4, we hope to provide you with a direct but flexible way to achieve first-class mobile support, whether you create a new website or enhance the existing site.
Changes to the default Template
We have improved the tag and CSS of the default Project template, so that the newly created Project can be as nice as on the mobile device. For example, we have added the viewport meta tag, and the page can also be well laid out on a small screen. Even if the page is designed for the desktop, there will be no strange amplification or reduction. Compared the pages built using the new and old templates:
New "mobile application" Project template
Another change being considered is a project template dedicated for mobile and tablet web applications. The project template contains layout, views, and scripts (such as jquery mobile) to build applications that provide rich user experience and optimize modern mobile devices. The page built with this template may be as follows:
View for special devices
You often need to crop the user interface to adapt to the user's device. We want to make override for views, segments, and la s of special device types easier. Whether you create a new project or upgrade an existing project to ASP. net mvc 4, this feature works properly.
For example, you can rewrite a special view for a mobile device. You only need to create a new view with ". Mobile" as the file name suffix:
We may also provide a new jquery mobile-based view template and enhance the add view and add controller dialog boxes, in this way, you can quickly add jquery mobile-based views for new or existing controllers and actions. The following figure shows the possible appearance of the add controller dialog box:
The options in the view type list are irrelevant to the view engine used by the application. The options that will not be changed during view conversion are moved to the view Options dialog box, as shown in:
Device Switch
Many websites provide visitors with a simple way to switch from a mobile experience to a desktop experience. We consider adding a device switch, which is both a helper for rendering the appropriate UI (switching from mobile to desktop or vice versa, depending on the current device settings) and an API for users to decide which experience to use.
Support for razor
You can add the. cshtml or. vbhtml file to the app_code folder of the Web application directory on the ASP. NET web page. You can use the razor syntax to compile auxiliary methods. Although these files can also be added in ASP. net mvc projects, they cannot access ASP. net mvc context objects (such as viewcontext) or ASP. net mvc htmlhelper instances.
In ASP. net mvc 4, Razor is supported in a specific MVC method. We are still studying the tools used to compile the razor auxiliary methods in the class library project so that they can be compiled into a library. We can reuse these libraries in other projects and write unit tests.
The asynccontroller class supports tasks and tasks <t>
It is very difficult to compile asynchronous actions in the current version of ASP. net mvc. For example, the following ASP. net mvc 3 code snippet shows an action method that calls two different asynchronous services.
public void IndexAsync(string city) { AsyncManager.OutstandingOperations.Increment(2); NewsService newsService = new NewsService(); newsService.GetHeadlinesCompleted += (sender, e) => { AsyncManager.Parameters["headlines"] = e.Value; AsyncManager.OutstandingOperations.Decrement(); }; newsService.GetHeadlinesAsync(); SportsService sportsService = new SportsService(); sportsService.GetScoresCompleted += (sender, e) => { AsyncManager.Parameters["scores"] = e.Value; AsyncManager.OutstandingOperations.Decrement(); }; sportsService.GetScoresAsync(); }public ActionResult IndexCompleted(string[] headlines, string[] scores, string[] forecast){ return View("Common", new PortalViewModel { NewsHeadlines = headlines, SportsScores = scores, }); }
The asynchronous action method is changed:
public async Task<ActionResult> Index(string city) { var newsService = new NewsService(); var sportsService = new SportsService(); return View("Common", new PortalViewModel { NewsHeadlines = await newsService.GetHeadlinesAsync(), SportsScores = await sportsService.GetScoresAsync() });}CSS and JavaScript packaging Integration
ASP. net mvc 4 combines multiple. CSS and. js files into one package. By removing unnecessary blank spaces and comments, the final file size can be reduced. This reduces the bandwidth usage and download time, and increases the page rendering speed.
Other features
We have not enriched all the features that need to be considered. The items listed below need to be implemented first. Some may need to be released by other teams.
- EF code first data migrations supports migrating from one database architecture version to another without data loss.
- Provides better support for application code functions and integration tests.
- Supports WCF Web APIs.
- Comprehensively improve Ajax. We hope to reduce the difficulties encountered by developers when using Ajax in ASP. net mvc.
- The editor/display template and HTML auxiliary methods support HTML5. For example, when a datetime attribute is presented, the editor template presents an input element whose type is set to date, instead of an input element whose type is set to the default text. In addition, the existing HTML auxiliary methods such as textboxfor will also be updated, and appropriate input elements can be displayed based on the model type.
- The template of the mobile Web project.
- Supports the "Donut Hole" cache and the Windows Server app fabric cache provider in the razor view.
- The new areaattribute class provides better security when using area.
Disclaimer
This document is only a preliminary document, so this section may have significant modifications before the software is finally released.
The content in this document represents Microsoft's views on the current issue since the date of publication. As Microsoft needs to respond to the ever-changing market in a timely manner, this document cannot be considered as a commitment, and Microsoft cannot guarantee the accuracy of any information.
This White Paper is for reference only. Microsoft does not provide any legal guarantee, express, or implied information in the document.
It is the user's responsibility to comply with all applicable copyright laws. Without the written permission of Microsoft, without limiting the rights stipulated by copyright law, any content in this document is copied, stored, indexed, or transmitted.
Microsoft is entitled to patents, patent applications, trademarks, copyrights or other intellectual property rights in this document. Unless expressly specified in Microsoft's written license, no patents, trademarks, copyrights and other intellectual property rights in this document shall be used.
If there is no additional explanation, the company, organization, product, domain name, e-mail, logo, person, location, and event here are all fictitious, without any hint, you cannot infer any actual company, organization, product, domain name, e-mail, logo, person, location, or event.
2011 Microsoft Corporation. All rights reserved.