Home  /  Questions  /  Question

55   94.7
Jun 15, 2014

Which design patterns are required for layered architecture?


I need to design an extensible architecture in which mysystem is able to be connected to different data sources for example legacy databases or public data banks. I was thinking to design a layered architecture including data access layer, processing layer and user interface layer. My questions are:

   1.      Is layered architecture an appropriate solution? which layers I require?

  2.        In order to achieve a layered architecture, which patterns I should use? I saw one document which achievesit by using adapter, observer and abstract factory. However, I do not know howto apply them in my case.

Thanks in advance

508   99.9
Jun 26, 2014
Most  well-designed applications use a Presentation, Business and Data layer.  Application layering is a large topic that cannot be explained in a couple paragraphs.  However, if you need 'real-world' explanations and code I  actually recommend our .NET Design Pattern Framework.  It was specifically designed for developers like you who need assistance with establishing a solid architecture using proven patterns.   

Hope this helps. 

588   99.9
Sep 21, 2014
Personally I wouldn't get too complicated trying to implement adapter, observer patterns, etc., unless parts of your application dictate it. Don't think of those patterns as a means of building a layered application, but more of a way to solve problems in your execution.

Jack is right in suggesting to look at his Patterns In Action application, it's a clear demonstration of how to build a layered application that helps your application stay flexible.

You can also visit my site to check out my series on the Repository Pattern with the Unit Of Work and Entity Framework 6.  It too demonstrates how to build a layered application where the logic and data access is easily controlled and maintainable.  I was able to build that framework based on knowledge that I received from the Do Factory folks.


The main thing to keep in mind is to abstract away the logic from the presentation and the data access and you will be able to have specific parts of your application connect to specific data sources.  WebApi also makes this very easy.

I hope this helps.

King Wilder