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
₹799 ₹2621.99
Paperback
₹3276.99
Subscription
Free Trial
Renews at ₹800p/m

What do you get with a Packt Subscription?

Free for first 7 days. ₹800 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781847195500
Vendor :
Microsoft
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. ₹800 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

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
₹800 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
₹4500 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 ₹400 each
Feature tick icon Exclusive print discounts
₹5000 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 ₹400 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 13,108.97
ASP.NET 3.5 Application Architecture and Design
₹3276.99
IBM Websphere Portal 8: Web Experience Factory and the Cloud
₹4915.99
Microsoft SQL Server 2012 Performance Tuning Cookbook
₹4915.99
Total 13,108.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 included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.