You are previewing ASP.NET 3.5: Application Architecture and Design: Build robust, scalable ASP.NET applications quickly and easily.
O'Reilly logo
ASP.NET 3.5: Application Architecture and Design: Build robust, scalable ASP.NET applications quickly and easily

Book Description

Application architecture is an essential skill for ASP.NET developers. It is always tempting to jump in and start coding, but planning your architecture early in the project will leave you with a solid application that scales well, is easy to modify and extend, and saves you time and effort later on. As businesses struggle to control their costs, writing solid code that can be extended easily is becoming even more important.

This book takes a pragmatic approach to Application Architecture in ASP.NET 3.5. It presents a series of common architectural models, and shows how to select the best ones for your project and apply them.

The book begins by showing you how to use the main architectural models in your applications. You will see how to implement n-tier architectures, MVC, design patterns, and more. But this is no software engineering theory book - it is a practical, hands-on guide that shows you how to use these techniques in your software straight away. We then go on to build SOA (Service-Oriented Architecture) applications with the Windows Communication Framework (WCF). Finally the book contains some essential guidance on effective database design, and a chapter on localizing your applications.

This book is a great way to learn ASP.NET Architecture in a practical, hands-on way. It will also serve as a quick reference for improving your application design.


This is a practical hands-on book with clear instructions and lot of code examples. It takes a simple approach, guiding you through different architectural topics using realistic sample projects.

A single project is implemented using different architectural styles to make the reader understand the details of each style. There are also many small independent code samples to explain design patterns, WCF, and localization.

Table of Contents

  1. ASP.NET 3.5
  2. Credits
  3. About the Author
  4. About the Reviewers
  5. Preface
    1. What This Book Covers
    2. What You Need for This Book
    3. Who is This Book For
    4. Conventions
    5. Reader Feedback
    6. Customer Support
      1. Downloading the Example Code for the Book
      2. Errata
      3. Piracy
      4. Questions
  6. 1. Introduction to Architecture and Design
    1. Software Architecture
    2. Software Design
    3. Architectural Styles
    4. Architecture and Design in ASP.NET
      1. Technology and Art
    5. Architecture: First Steps
    6. Design Patterns
    7. Project Life Cycle
      1. Project Initiation
      2. Project Planning and Prototyping
        1. Project Plan
        2. Use Case Design
        3. Prototyping
        4. Class Model
        5. Database Model
      3. Project Construction: Programming and Development
      4. Project Transition and Release
    8. Tiers and Layers
      1. Physical Separation
      2. Logical Separation
      3. Single Tier—Single Layer Model
      4. Single Tier—Two Layer Model
      5. Single Tier—Three Layer Model
      6. Two Tier Model
      7. Two Tier—Two Layer Model
      8. Three Tier Model
    9. Summary
  7. 2. 1-Tier 1-Layer Architecture in ASP.NET
    1. Default N-Tier Nature of Web Applications
    2. Classic ASP Style: Inline Coding
      1. Sample Project using Inline Code
    3. Code-Behind Model: The Second UI Layer
      1. Sample Project using Code-Behind
      2. Limitations of Coding in the UI Layer
    4. Data Source Controls
      1. A Sample Project using Inbuilt Data Source Controls
    5. Summary
  8. 3. ER Diagrams, Domain Model, and N-Layer Architecture
    1. Entity-Relationship Diagram
      1. Degree and Cardinality of a Relationship
    2. OMS Project using 2-Layer
        1. Sample Project
    3. Domain Model using UML
      1. Class Diagram
      2. UML Relationships
        1. Dependency Relationship
        2. Association Relationship
            1. Aggregation
            2. Composition
        3. Generalization Relationship
        4. Realization Relationship
        5. Multiplicity
    4. 1-tier 3-layer Architecture using a Domain Model
      1. Layer 1: Data Access Layer (DAL)
      2. Layer 2: Business Layer (BL)
      3. Layer 3: The UI Layer
    5. Object Data Source Controls
    6. Summary
  9. 4. N-Tier Architecture
    1. Why N-Tier?
      1. Performance
      2. Scalability
      3. Re-usability
      4. Loose-Coupling
      5. Plug and Play
    2. A 4-Tier Approach
    3. 5-Tier Architecture
      1. Data Transfer Objects
      2. Lazy Loading
      3. Updating Business Objects
      4. GUI Tier
      5. Generics and Custom Collections
    4. Summary
  10. 5. Model View Controller
    1. Page Controller Pattern in ASP.NET
      1. Problems with Page Controller Design
      2. GUI Unit Testing
    2. MVC Design: A Front Controller based Approach
      1. Front Controller Design
      2. Basics of MVC
      3. REST: Representation State Transfer
      4. MVC and REST
    3. ASP.NET MVC Framework
      1. Sample Project
      2. URL Routing Engine
      3. The Controller
      4. The View
      5. The Model
      6. Wiring Controller, Model, and View
      7. Unit Testing and ASP.NET MVC
    4. Summary
  11. 6. Design Patterns
    1. Understanding Design Patterns
      1. History of Patterns
      2. Singleton Pattern
        1. Understanding Singleton with Code Example
      3. Factory Method
        1. Core Principle: Programming to an Interface instead of an Implementation
        2. The Need for Factory Design
      4. Dependency Injection
        1. Basic Approach
          1. Step 1: Create an Interface
          2. Step 2: Create an Implementation
          3. Step 3: Create another Implementation
          4. Step 4: Create a Factory Class
          5. Step 5: Implement the Configuration Settings
          6. Step 6: Implement another Custom Algorithm
      5. Command Design Pattern
        1. Decoupling the GUI completely from the BL
        2. Creating the Command Interface
        3. Creating the Value Objects
        4. Creating the Command Factory
      6. Tying it all up with the GUI
    2. Summary
  12. 7. SOA and WCF
    1. Understanding Application Size, Scope, and Granularity
      1. Small Applications Versus Big Applications
      2. Tight and Fine-Grained Domain Model
      3. Coarse-Grained Model
    2. What is SOA?
      1. Why SOA?
      2. Service Orientation
      3. XML Web Services and SOAP Messages
    3. Sample Project
      1. Building a Service Interface
      2. Consuming Services
    4. Windows Communication Foundation
      1. Sample Project using WCF
    5. Summary
  13. 8. Database Design
    1. The Importance of a Database
      1. Selecting the Right Database
    2. Database Architecture and Design
      1. Database Plan
      2. Logical Design
      3. An Example of a Logical Model
      4. The Need for a Logical Data Model
      5. The Domain Model Versus the Logical Data Model
    3. Physical Data Model
      1. Data Integrity
      2. Normalization
    4. Data Modeling using MS Visio
      1. Creating Physical Tables
      2. Creating Relationships
    5. Summary
  14. 9. Localization
    1. Globalization and Localization
      1. Browser Settings
    2. Basic Steps for Globalizing an ASP.NET Website
      1. Culture and Locale
        1. How do we Define or Change the Current Culture?
        2. Switching Locale
      2. Resource Files
        1. Global Versus Local Resources
        2. Creating Global Resources
        3. Creating Local Resources
      3. Choosing between Global and Local Resources
        1. Satellite Assemblies
      4. Implicit Versus Explicit Localization
    3. Incorporating Globalization
      1. Setting the Culture of the Thread Based on User Selection
      2. dir Attribute for Language Direction
      3. Editing Resource Files after publishing in ASP.NET 3.5
      4. Entering Foreign Language Characters: Input Method Editor (IME)
    4. Using a Database for Localization
      1. Custom Resource-Provider-Model in ASP.NET
    5. Summary