CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeffrey Palermo [MVP]

Software management consultant and CTO, Headspring Systems

General application architecture diagram - level 300

Many applications I've encountered and most of my first applications had loose or no defined architecture.   From a high level, everything just was.  And it worked.  And it became hard to maintain.  I've been researching better ways to organize the application and how to take advantage of high-level design patterns.  With this knowledge, I've developed a general architecture for any application with a UI (apps without a UI will just lack that layer, and, of course, I haven't included a service layer (which might even be the interface layer).

My goal was to describe how the layers might interact and what bindings would exist.  The most important things follow:  The UI layer holds references to the process and business layers and no others.  The process layer holds references to the repository, business, and UI layers.  The repository layer references business and DAL.  The business layer references nothing (and this is key for object portability).  The DAL references only the database (most likely through the connection string) but holds no assembly references except ADO.NET, of course.

With this architecture, we can implement Model-View-Presenter,  Repositories, and Observer.   For example, the Process layer would hold presenter objects that invoke business objects and set the View (UI).  The View observes business objects but does not control them.  The Presenter objects control the process layer and invoke the repository classes to get or persist the business objects.  The repository layer does this by calling the correct classes of the DAL.  And then, if the database changes (either in vender or schema), only the DAL needs to be changed.  The DAL should expose classes that return data by calling the right query in the database.  The DAL might wrap ADO.NET or perhaps the Data Access Application Block for the direct database access.  The DAL would know the names of stored procedures.  The repository objects would not know this.  Rather the repository objects would just know what class and method to invoke to get information with which to populate a business object.  The DAL should return generic objects such as an IDataReader. 

I've read a lot about application design patterns and best practices, but I wish there was some more architecture guidance out and about.  I think the industry would benefit from standard approaches to application development from a high level.  We hear a lot about n-tier and business layers, but a business layer that knows how to persist its own objects is not the way to go, so I see this guidance lacking.

Feedback is welcome on the above diagram.



Comments

Jeff N said:

Hi,

I like the diagram you've done above. I'm currently working on a .NET SmartClient app - 3 tier - and I've got an architecture diagram from Visio that looks pretty poor compared to the one you've done above.

What tool did you use for this diagram?

Thanks,

Jeff
# October 14, 2005 6:51 PM

Jeffrey Palermo said:

I used Visio to create this.
# October 14, 2005 7:22 PM

Manoj said:

Hi Jeffrey Palermo,

\

I like the design and flow you have designed.  but i have some query in this.  being a new developer .net  can you please brief out the Process assembly layer in which you have mentioned process, presenter, and controller class.  I will be greatfull to you if you can give some knowledge on this layer as well.

thanks

Manoj Kakkar

# September 20, 2007 4:38 AM

About Jeffrey Palermo

Jeffrey Palermo is a software management consultant and the CTO of Headspring Systems in Austin, TX. Jeffrey specializes in Agile coaching and helps companies double the productivity of software teams. Jeffrey is an MCSD.Net , Microsoft MVP, Certified Scrummaster, Austin .Net User Group leader, AgileAustin board member, INETA speaker, INETA Membership Mentor, Christian, husband, father, motorcyclist, Eagle Scout, U.S. Army Veteran, and Texas A&M University graduate. Check out Devlicio.us!

This Blog

Syndication