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
€8.99 €25.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
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.
Estimated delivery fee Deliver to Hungary

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

Product Details

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

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Hungary

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.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
€189.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
€264.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 130.97
ASP.NET 3.5 Application Architecture and Design
€32.99
IBM Websphere Portal 8: Web Experience Factory and the Cloud
€48.99
Microsoft SQL Server 2012 Performance Tuning Cookbook
€48.99
Total 130.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

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela