Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
ASP.NET 3.5 Application Architecture and Design
ASP.NET 3.5 Application Architecture and Design

ASP.NET 3.5 Application Architecture and Design: Build robust, scalable ASP.NET applications quickly and easily.

eBook
$9.99 $25.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

ASP.NET 3.5 Application Architecture and Design

Chapter 2. 1-Tier 1-Layer Architecture in ASP.NET

It's time to get our hands dirty with ASP.NET coding! In this chapter, we will understand through the use of examples:

  • How every web application is N-tiered by default

  • How applications based on classic inline ASP are tightly coupled

  • What 1-tier 1-layer architecture is

  • Code-behind classes in ASP.NET as another layer in the UI tier

  • How Data Source Controls fit into the application architecture of ASP.NET web applications

This chapter is not a guide to how data source controls work, but is rather focused on the architectural aspects of using them and learning about the advantages and disadvantages of data source controls, instead of going into the deep technical details of using them.

Default N-Tier Nature of Web Applications

When working with web applications, a very important concept to grasp is that by its very own nature each web application is distributed and is inherently 2-tier by default (or 3-tier if we include the database as a separate tier...

Default N-Tier Nature of Web Applications


When working with web applications, a very important concept to grasp is that by its very own nature each web application is distributed and is inherently 2-tier by default (or 3-tier if we include the database as a separate tier). Therefore, it is not possible to have a single-tier (or 1-tier) architecture at all, when dealing with web applications. And as we saw in the last chapter, if we include a database and client browser in our system, then we already have a basic 3-tier application structure.

Let's understand this concept in detail with a sample configuration for a simple ASP.NET web application:

  • Web Server: A machine running a web server such as IIS, handling all HTTP requests and passing them onto the ASP.NET runtime process. The deployed project files (ASPX, ASCX, DLLs etc) are published on this server.

  • Database Server: This will be the physical database such as SQL Server, Oracle and so on. It can be on the same machine as the web server...

Classic ASP Style: Inline Coding


Firstly, we will study the classic inline style of coding, which was the only option available during the good old ASP 3.0 days. This was a mix of interpreted ASP scripts and HTML code. In terms of architecture, there was not much flexibility, although developers used classes to bring some object oriented flavor to the projects, but these were not pure OO classes. Core features such as inheritance were not supported. Moreover, there was lot of effort involved in coding these classes, so most developers preferred to mix coding that was much faster in terms of development time. At a high level, an ASP project configuration would usually follow the given diagram:

In this diagram, we have ASP script files in the web server directory being processed by ASP ISAPI (Internet Server Application Programming Interface) DLL in IIS and rendered in the client browser. ISAPI DLL is a part of IIS itself, and not a separate process such as the ASP.NET runtime engine.

Here...

Code-Behind Model: The Second UI Layer


In the above classic ASP style example, we noticed that the code and HTML were separated but still present on the same ASPX page. ASP.NET introduced further separation using the principle of code-behind classes, by pulling all of the code out from the ASPX into a separate class and compiling it to a separate DLL. (Note that a DLL is not really required either, if the developer wishes to deploy the code-behind into the web directory. ASP.NET will compile the code "Just-In-Time" into a temporary DLL, so "pre-compiling into a DLL" is not required either.) This allowed the programmers to debug their applications more efficiently and also introduced further loose coupling in the UI layer, introducing another layer into the above 1-tier architecture.

Here is a diagrammatic representation of the above style:

The partial class compilation model was introduced with ASP.NET 2.0. Partial classes help us break up a main class into sibling classes, which can be merged...

Data Source Controls


With further refinements to ASP.NET 2.0, Microsoft has added many out-of-the-box controls (apart from the standard web control library). Some of the most useful controls are Data Source Controls, complimenting the feature-rich web server controls such as the GridView and the DetailsView. These controls have made it possible to create applications without writing even a single line of data access code. Now it is possible to create web applications within a short timespan, doing away with many lines of routine data access code.

With Data Source Controls, we can use SQL queries as well as stored procedures, and write custom code too. Although we won't go deep into the details of how to use controls, as there are many freely-available online resources and articles on this subject, we will see how using these controls affects the overall architecture, when to use them and what their disadvantages are.

A Sample Project using Inbuilt Data Source Controls

Let's start with our...

Summary


In this chapter, we examined how web applications inherently follow a 3-tier client-server model, and how a 1-tier architecture can be used for simple applications in ASP.NET. Then we learned how we can logically partition this basic 1-tier 1-layer architectural style into two sub-layers, using code-behind files. We also studied how declarative code-less programming using new Data Source Controls follows a single-layer style.

In a nutshell:

  • Classic inline coding should not be used unless absolutely necessary. One case supporting it would be a project that mixes classic ASP and ASP.NET, or a project already built using this style of coding.

  • Data Source Controls (except Object Data Source) are only good for small projects which will never need to be scaled up in the future. For commercial-level projects, it's very important to logically break the code into layers.

  • The code-behind style is much more flexible, object-oriented, and scalable for commercial projects. We can break these layers...

Left arrow icon Right arrow icon

What you will learn

  • Explore different architectural options while creating web solutions tiers, layers, and logical structuring Master the concept of n-tier architecture and used design patterns in ASP.NET Implement the new ASP.NET MVC design in your applications Build an SOA application and see how WCF compliments it Design scalable and maintainable applications Deploy your localized applications and learn the best practices for your localization framework Learn better database design that can go with your application Explore best practices on how to globalize your commercial web applications Chapter 1: Introduction to Architecture and Design. This chapter will introduce you to architecture and design in ASP.NET, including tiers, layers, and logical structuring. Chapter 2: 1-Tier 1-Layer Architecture in ASP.NET. This chapter discusses the advantages and disadvantages of using the simplest and easiest 1-tier, 1-layer default architecture in ASP.NET. Readers will also understand when and why we should use out-of-the-box data source controls, and how 1-tier and 1-layer style is tightly coupled and not flexible or scalable. Chapter 3: ER diagrams, Domain Model and n-Layer Architecture. This chapter discusses what an ER diagram is, the domain model, the basics of UML, what an n-layer design is, and how it increases flexibility and maintainability of the code compared to a 1-layer architecture. A sample project is explained with code in a 3-layer model. The drawbacks/limitations of this model are also discussed. Chapter 4: N-Tier Architecture. This chapter talks about n-tier architecture in ASP.NET and how to implement it. It also explains the Data Transfer objects and how to use them, 4-tier and 5-tier web solutions. Chapter 5: MVC Design and ASP.NET MVC Framework. In this chapter you will learn and understand what MVC design is and how ASP.NET MVC framework helps us quickly implement MVC design in our web applications. Chapter 6: Design Patterns. In this chapter you will learn how and when to use the most common design patterns in ASP.NET: Factory, Dependency Injection, Singleton, and others. Chapter 7: SOA and WCF. This chapter explains why we need SOA, explaining the advantages of SOA for a beginner. A sample project using SOA architecture is discussed. The chapter also teaches how the Windows Communication Framework compliments SOA. Chapter 8: Best Practices in Database Design. This chapter deals with the importance of a well designed database, balanced normalization, logical and physical models, tips and tricks for better database models. Chapter 9: Localization. This chapter covers localization for ASP.NET applications, deployment of localized applications, localization framework, and best practices.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 24, 2008
Length: 264 pages
Edition :
Language : English
ISBN-13 : 9781847195517
Vendor :
Microsoft
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Oct 24, 2008
Length: 264 pages
Edition :
Language : English
ISBN-13 : 9781847195517
Vendor :
Microsoft
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 175.97
ASP.NET 3.5 Application Architecture and Design
$43.99
IBM Websphere Portal 8: Web Experience Factory and the Cloud
$65.99
Microsoft SQL Server 2012 Performance Tuning Cookbook
$65.99
Total $ 175.97 Stars icon
Banner background image

Table of Contents

9 Chapters
Introduction to Architecture and Design Chevron down icon Chevron up icon
1-Tier 1-Layer Architecture in ASP.NET Chevron down icon Chevron up icon
ER Diagrams, Domain Model, and N-Layer Architecture Chevron down icon Chevron up icon
N-Tier Architecture Chevron down icon Chevron up icon
Model View Controller Chevron down icon Chevron up icon
Design Patterns Chevron down icon Chevron up icon
SOA and WCF Chevron down icon Chevron up icon
Database Design Chevron down icon Chevron up icon
Localization Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(8 Ratings)
5 star 62.5%
4 star 25%
3 star 0%
2 star 12.5%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Kenzo Jun 20, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
When it comes to asp.net, Microsoft's visual studio is like a web page "wizard" in many ways. It lets you generate asp.net web pages and sites without understanding much of what is needed to make it work.However the danger there is that it is easy to pile on more and more pages and code until very shortly you have a site that can't scale, with spaghetti code that is extremely difficult to update.This book does a really excellent job of guiding you towards designs that _can_ scale, and that won't leave you tearing your hair out trying to make enhancements.Read and understand it, and use the techniques in EVERY site you build.
Amazon Verified review Amazon
Robert S. Robbins Dec 30, 2008
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've been hearing a lot about domain models and design patterns in the ASP.NET world and quite frankly it mystified me because I didn't get it. It seemed like developers were more interested in what used to be called systems analysis than in web application development. Fortunately this book is perfect for explaining these concepts to an experienced ASP.NET developer. I found clear explanations of lazy loading, front controller design, model view controller, singleton pattern, factory method, dependency injection, command design pattern, etc. And the author describes how all of these design patterns and domain models can be implemented in ASP.NET so you aren't left wondering how it applies to web application development.I also appreciated the fact that Vivek Thakur has a no nonsense attitude about how worthwhile a particular architecture may be for a particular project. Since I don't work on a large development team and my projects aren't commercial and don't need to scale or integrate with legacy systems, most of these advanced application architectures would be inappropriate. This book confirms my suspicion that some design patterns and domain models aren't justified for small and simple projects with low budgets.Although the implementation details are sketchy and don't apply to my projects, I still picked up a few coding tips. But the main benefit to reading this book is that it demystifies many concepts that are being kicked around.
Amazon Verified review Amazon
T E May 27, 2009
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is an excellent book for beginner to intermediate programmers who want to see a practical basic approach to OOAD and Domain modelling in ASP.NET.It is not a reference guide on any of the .NET topics, but more of a straight, simple and informative text that throws light on a lot of day-to-day issues and choices which a developer might have to make while working on different projects.I highly recommend this book to all .NET developers, both Windows and Web!
Amazon Verified review Amazon
Amazon Customer Aug 27, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book runs true to Alice in wonderlands "that's the reason they are called lessons because they lessen from day to day"; if you got a thorough grasp over the basics then you can move faster through the more complicated ones with increasing clarity. The book employs a deductive reasoning approach.
Amazon Verified review Amazon
Vivek Thakur May 07, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Nice book
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.