Chapter1:design the application Architecture

Source: Internet
Author: User

1.1 Plan the application layers

Referred to repository Pattern,soc (separation of Concern),

Further mentions Mvc,action/action results,route/routing (IHttpHandler, Mvchandler, icontrollerfactory), Asynchronous Controllers , Views (strongly-typed views, view-specific model, partial view, Master page), razor/webforms view Engine

1.2 Design a distributed Application

REST service vs ASP. NET Web Services (ASMX) vs WCF web API

Call the rest API via Httpservice (why not httpclient?)

Hybrid application-azure Server + local app server/local DB server via Azure AppFabric

3 Session Management modes: InProc (default)/outproc (stateserver or SQL Server)

1.3 Deign and implement the Windows Azure role life cycle

Startup tasks Management by APPCMD

1.4 Configure State Management

ASP. NET uses ViewState to manage state information.

ASP. NET MVC uses the following methods to save state information:

    • Cache-memory pool on server, shared across users
    • session-stored on server, unique for each user
    • cookie-stored on client, passed with each HTTP request to the server
    • Querystring-passed as part of the URL string
    • Context.items-part of HttpContext and lasts only the lifetime of this request
    • Profile-stored in DB and maintains information across sessions

Cookies

    • 4k limit
    • Support feature such as Remember Me.

HTML5 Web Storage

    • Browser compatible
1.5 Design a cache strategy

Use the OutputCache property to control the scope of the cache, the value of the location: any (default)/client/downstream/server/serverandclient/none.

Donut caching support via Substitution API of ASP.

Donut Hole Caching:

    1. Use the OutputCache property on a method that returns an action (Childaction)
    2. Use @html.action ("Childaction") in parent view

If you use the OutputCache property on a controller, all methods that support GET request have this property, and the other methods are not affected.

For the distributed caching to be used for AppFabric, the (. NET version of Redis should also support it!). )

Use System.Runtime.Caching.dll's default implementation Objectcache/memorycache to implement the data Caching.

HTML5 supports application Cache API (AppCache),

    1. Generate Cache manifest,
    2. Reference manifest in layout.cshtml, such as
    3. Set the correct mime-type,response.contenttype= "Text/cache-manifest".

Http caching.

1.6 Design and implement a WebSocket strategy

The WebSocket connection is established through the hand shake, and the server side passes HttpContext.Current.AcceptWebSocketRequests (Func<aspnetwebsocketcontext, task>) completes the Get to WebSocket upgrade.

Because WebSocket does not contain HTTP header information, it may not be able to pass through firewall.

1.7 Design HTTP modules and handlers

The difference between HTTP module and HTTP handler

Familiar with the default modules and handlers of ASP.

Chapter1:design the application Architecture

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.