Designing and Developing Web Applications Using Microsoft .NET Framework 4: Designing the Application Architecture
- 10/17/2011
- Objective 1.1: Plan the Division of Application Logic
- Objective 1.2: Analyze Requirements and Recommend a System Topology
- Objective 1.3: Choose Appropriate Client-Side Technologies
- Objective 1.4: Choose Appropriate Server-Side Technologies
- Objective 1.5: Design State Management
- Chapter Summary
- Answers
Chapter Summary
Client-side scripting provides users with a rich interface, but it lacks the robustness and security of server-side code. SoC simplifies development, testing, and the updating of large-scale web applications by dividing the functional layers of an application. To perform a long-running request while appearing responsive to the user, divide a request into multiple asynchronous steps.
The two most commonly used system architectures are MVC and three-tier. MFC allows different applications to communicate with a variety of bindings that provide different levels of features, performance, and compatibility. Unless you need multiple servers for redundancy, scalability, or isolation, use a single server. Whenever possible, use coding best practices that separate cross-cutting concerns into separate classes and store settings administrators might want to change separately from your code.
JavaScript is the only widely accepted client-side scripting language, and it can be extended with the jQuery and Microsoft AJAX libraries. When you need more capabilities than JavaScript can provide, use a plug-in such as Flash or Silverlight. However, you will need to write extra code to provide down-level functionality for browsers that do not support the plug-in.
HTML controls provide high performance with minimal overhead, but server controls provide much easier access to their properties and values. Custom server controls require extra development effort but provide the most flexibility. Use HtmlHelper extensions to add custom HTML elements to MVC views. To improve page responsiveness, update individual elements within a page using Microsoft AJAX page methods.
The Application and Cache objects provide dictionaries that can be accessed by any page and session. You can use cookies and sessions to track information about individual users. ASP.NET stores view state in hidden fields within a page, allowing it to recall server control properties when a page is posted back.