Chapter 3. Planning an Architecture
This chapter lays the groundwork for the rest of the book by creating a number of basic services that will be shared among all future modules: configuration classes to process custom sections and elements in web.config
, base business classes and the Entity Framework model, caching strategies, and more. I'll show you the ListView
control introduced in ASP.NET 3.5, and we'll build an n-tier architecture to manage interacting with the database.
Problem
Our website is made up of a number of separate modules for managing dynamic content such as articles, forums, photo galleries, events, and polls, and sending out newsletters. However, all the modules have a number of common "design" tasks that you must deal with:
Create a sound Entity Framework model that will manage the data access.
Create a base for a business logic layer to manage interaction with the Entity Framework and to validate data.
Expand and customize the business object architecture generated by the Entity Framework Wizard to expose the data retrieved by the data access layer in an object-oriented format. This will leverage the use of partial classes introduced in .NET 2.0.
Separate the business logic code from the presentation code (user interface) so that the site is much more maintainable and scalable. This is called a multi-tier design.
Support the caching of business objects to save the data you've already fetched from the data store so that you don't have to make unnecessary fetches to ...
Get ASP.NET 3.5 Website Programming: Problem-Design-Solution now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.