views:

304

answers:

4

In the search for resources to become a better developer, I am looking for good examples of how to structure the code in n-tier applications.

Like... What does the business object do and look, how does it interface with the data access layer etc. How does the UI interface the business layer, and does it interface the DAL directly.

Do you know of great examples freely available, that are worthy of study?

A: 

I would suggest looking at the S#arp Architecture project that Billy McCafferty et al have been developing.

In addition to being a great foundation architecture for building n-tier .net applications of the type you describe, it includes a sample Northwind application which you can poke around with.

Have fun!

Ian Nelson
A: 

Also, the book Enterprise Application Architechture by Martin Fowler is a must read. Google it or use the amazon link provided. Enterprise Application Architecture on Amazon.

Magnus
+1  A: 

Have a look at this example: http://www.codeplex.com/TheBeerHouse, which was developed as the example for this book: http://www.amazon.com/gp/product/0764584642

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.

Have a look at the wikipedia article on n-tier architecture: http://en.wikipedia.org/wiki/Multitier_architecture. The presentation tier is implemented as pages and user controls in the example I have given, the logic tier (commonly called BLL or business logic layer) is concrete C# classes defining specific behaviour, and the data tier (commonly called DAL or data access layer) is abstract C# classes defining the storage mechanism with concrete C# classes for using Sql Server as the storage medium.

Hope this helps.

Paul Suart
+1  A: 

Microsoft Patterns & Practices have made an application architecture guide: http://www.codeplex.com/AppArch

They even made videos explaining what you are looking for.

khebbie
Paul Suart