views:

255

answers:

6

I would like to learn how to do n-tier development. I would likd to separate my web application to multiple layers:

  • Presentation Layer
  • Business logic layer
  • Data Access Layer

Does anyone have any advice on any resources that would help me learn how to build applications in this manner?

Note: Some programmers have advised me to use "SubSonic" as a DAL , but I am unfamiliar with how to use it - any book suggestions about SubSonic would be appreciated as well.

A: 

I think what you are looking for is MVC. I don't know any books, but there's plenty of good online resources at Microsoft's ASP.NET website.

MVC stands for Model, View, Controller, and they map almost perfectly to what you asked about:

  • Presentation Layer -> View
  • Business logic layer -> Controller
  • Data Access Layer -> Model
Matthew Scharley
I don't see MVC as the 3 layers that were asked.In you answer you only go as far as the Business Logic Layer, which *could* be your Model. The same for the Presentation Layer, which is the View.As for the Controller, it's also part of a Business Logic Layer, or could have it's own layer.
Nelson Reis
I agree with Nelson - MVC is not an example of n-tier architecture. MVC is an example of the presentation layer.
Andrew Hare
+2  A: 

Domain Driven Design by Eric Evans. (Amazon)

For me, this represents the 'new and improved' way to separate your application in separate layers.

Eric Minkes
+5  A: 

I would suggest Patterns of Enterprise Application Architecture:

The practice of enterprise application development has benefited from the emergence of many new enabling technologies. Multi-tiered object-oriented platforms, such as Java and .NET, have become commonplace. These new tools and technologies are capable of building powerful applications, but they are not easily implemented. Common failures in enterprise applications often occur because their developers do not understand the architectural lessons that experienced object developers have learned.

Patterns of Enterprise Application Architecture is written in direct response to the stiff challenges that face enterprise application developers. The author, noted object-oriented designer Martin Fowler, noticed that despite changes in technology--from Smalltalk to CORBA to Java to .NET--the same basic design ideas can be adapted and applied to solve common problems. With the help of an expert group of contributors, Martin distills over forty recurring solutions into patterns. The result is an indispensable handbook of solutions that are applicable to any enterprise application platform.

This book is actually two books in one. The first section is a short tutorial on developing enterprise applications, which you can read from start to finish to understand the scope of the book's lessons. The next section, the bulk of the book, is a detailed reference to the patterns themselves. Each pattern provides usage and implementation information, as well as detailed code examples in Java or C#. The entire book is also richly illustrated with UML diagrams to further explain the concepts.

Armed with this book, you will have the knowledge necessary to make important architectural decisions about building an enterprise application and the proven patterns for use when building them.

The topics covered include:

  • Dividing an enterprise application into layers
  • The major approaches to organizing business logic
  • An in-depth treatment of mapping between objects and relational databases
  • Using Model-View-Controller to organize a Web presentation
  • Handling concurrency for data that spans multiple transactions
  • Designing distributed object interfaces
Andrew Hare
+1  A: 

Have a look at this book: http://www.amazon.com/gp/product/0764584642 and its accompanying example: http://www.codeplex.com/TheBeerHouse

It's .net 2.0 and not perfect, but it's a great example of an n-tier application that makes good use of the provider model. We've adapted the pattern and use if for 90% of our in-house development. Make sure you don't confuse this pattern with the MVC pattern, as they are quite different.

Hope this helps.

Paul Suart
+2  A: 

Thanks to everyone for advices.

i found what i'm looking for in this book:

ASP.NET 3.5 Application Architecture and Design. It's good simple and cover especially ASP.NET.

So it's good to read especially for intermediate programmer.

Thanks to all of you.

Wahid Bitar