Book description
Get up and running with ASP.NET MVC 4, and learn how to build modern server-side web applications. This guide helps you understand how the framework performs, and shows you how to use various features to solve many real-world development scenarios you’re likely to face. In the process, you’ll learn how to work with HTML, JavaScript, the Entity Framework, and other web technologies.
You’ll start by learning core concepts such as the Model-View-Controller architectural pattern, and then work your way toward advanced topics. The authors demonstrate ASP.NET MVC 4 best practices and techniques by building a sample online auction site ("EBuy") throughout the book.
- Learn the similarities between ASP.NET MVC 4 and Web Forms
- Use Entity Framework to create and maintain an application database
- Create rich web applications, using jQuery for client-side development
- Incorporate AJAX techniques into your web applications
- Learn how to create and expose ASP.NET Web API services
- Deliver a rich and consistent experience for mobile devices
- Apply techniques for error handling, automated testing, and build automation
- Use various options to deploy your ASP.NET MVC 4 application
Table of contents
- Programming ASP.NET MVC 4
- SPECIAL OFFER: Upgrade this ebook with O’Reilly
- Preface
-
I. Up and Running
- 1. Fundamentals of ASP.NET MVC
- 2. ASP.NET MVC for Web Forms Developers
- 3. Working with Data
- 4. Client-Side Development
-
II. Going to the Next Level
- 5. Web Application Architecture
- 6. Enhancing Your Site with AJAX
- 7. The ASP.NET Web API
- 8. Advanced Data
- 9. Security
-
10. Mobile Web Development
- ASP.NET MVC 4 Mobile Features
- Making Your Application Mobile Friendly
- Improving Mobile Experience
- Adaptive Rendering
- Creating a New Mobile Application from Scratch
- Summary
-
III. Going Above and Beyond
- 11. Parallel, Asynchronous, and Real-Time Data Operations
- 12. Caching
-
13. Client-Side Optimization Techniques
- Anatomy of a Page
-
Best Practices
- Make Fewer HTTP Requests
- Use a Content Delivery Network
- Add an Expires or a Cache-Control Header
- GZip Components
- Put Stylesheets at the Top
- Put Scripts at the Bottom
- Make Scripts and Styles External
- Reduce DNS Lookups
- Minify JavaScript and CSS
- Avoid Redirects
- Remove Duplicate Scripts
- Configure ETags
- Measuring Client-Side Performance
- Putting ASP.NET MVC to Work
- Summary
- 14. Advanced Routing
- 15. Reusable UI Components
-
IV. Quality Control
- 16. Logging
-
17. Automated Testing
- The Semantics of Testing
- Levels of Automated Testing
- What Is an Automated Test Project?
- Testing an ASP.NET MVC Application
- Code Coverage
- Developing Testable Code
- Summary
-
18. Build Automation
- Creating Build Scripts
- Automating the Build
-
Continuous Integration
- Discovering Issues
-
The Principles of Continuous Integration
- Maintain a single source repository
- Automate the build
- Make your build self-testing
- Have everyone commit to the mainline frequently
- Every commit should build the mainline on an integration machine
- Keep the build fast
- Test in a clone of the production environment
- Make it easy for anyone to get the latest executable
- Everyone can see what’s happening
- Automate deployment
- Summary
- V. Going Live
-
VI. Appendixes
- A. ASP.NET MVC and Web Forms Integration
-
B. Leveraging NuGet as a Platform
- Installing the NuGet Command-Line Tool
- Creating NuGet Packages
- The Anatomy of a NuGet Package
- Types of NuGet Packages
- Tool Packages
- Sharing Your NuGet Packages
-
Tips, Tricks, and Pitfalls
- Pitfall: NuGet Does Not Solve “DLL Hell”
- Tip: Use Install-Package -Version to Install a Specific Package Version
- Tip: Use Semantic Versioning
- Tip: Mark “Beta” Packages with Prerelease Version Markers
- Pitfall: Avoid Specifying “Strict” Version Dependencies in Your NuSpec Files
- Tip: Use Custom Repositories to Control Package Versions
- Tip: Configure Your Continuous Integration Builds to Generate NuGet Packages
- Summary
-
C. Best Practices
- Use the NuGet Package Manager to Manage Dependencies
- Depend on Abstractions
- Avoid the New Keyword
- Avoid Referring to HttpContext Directly (Use HttpContextBase)
- Avoid “Magic Strings”
- Prefer Models over ViewData
- Do Not Write HTML in “Backend” Code
- Do Not Perform Business Logic in Views
- Consolidate Commonly Used View Snippets with Helper Methods
- Prefer Presentation Models over Direct Usage of Business Objects
- Encapsulate if Statements with HTML Helpers in Views
- Prefer Explicit View Names
- Prefer Parameter Objects over Long Lists of Parameters
- Encapsulate Shared/Common Functionality, Logic, and Data with Action Filters or Child Actions (Html.RenderAction)
- Prefer Grouping Actions into Controllers Based on How They Relate to Business Concepts
- Avoid Grouping Actions into Controllers Based on Technical Relation
- Prefer Placing Action Filters at the Highest Appropriate Level
- Prefer Multiple Views (and/or Partial Views) over Complex If-Then-Else Logic That Shows and Hides Sections
- Prefer the Post-Redirect-Get Pattern When Posting Form Data
- Prefer Startup Tasks over Logic Placed in Application_Start (Global.asax)
- Prefer Authorize Attribute over Imperative Security Checks
- Prefer Using the Route Attribute over More Generic Global Routes
- Consider Using an Antiforgery Token to Avoid CSRF Attacks
- Consider Using the AcceptVerbs Attribute to Restrict How Actions May Be Called
- Consider Output Caching
- Consider Removing Unused View Engines
- Consider Custom ActionResults for Unique Scenarios
- Consider Asynchronous Controllers for Controller Tasks That Can Happen in Parallel
- D. Cross-Reference: Targeted Topics, Features, and Scenarios
- Index
- About the Authors
- Colophon
- SPECIAL OFFER: Upgrade this ebook with O’Reilly
- Copyright
Product information
- Title: Programming ASP.NET MVC 4
- Author(s):
- Release date: September 2012
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449320317
You might also like
book
The Art of Communication
Bring nuance, depth, and meaning to every conversation you have The Art of Communication is for …
book
Modern Software Engineering: Doing What Works to Build Better Software Faster
Improve Your Creativity, Effectiveness, and Ultimately, Your Code In Modern Software Engineering, continuous delivery pioneer David …
audiobook
How to Do Nothing
A galvanizing critique of the forces vying for our attention-and our personal information-that redefines what we …
book
The Joy of JavaScript
The Joy of JavaScript introduces techniques that turn JavaScript programmers into JavaScript pros. You’ll work with …