Layered Architecture

From the code maintainability and reuse perspectives, the best way to make this code a bit easier to maintain would be by splitting up concepts, that is creating layers for each different concern. In our previous example, it's easy to shape different layers: one to encapsulate the data access and manipulation, another one to handle infrastructure concerns, and a final one for encapsulating the orchestration of the previous two. An essential rule of Layered Architecture — is that each layer must be tightly coupled with the layers beneath it, as shown in the following picture:

Layered Architecture for SoC

What Layered Architecture really seeks is the separation of the different components of an application. For instance, in terms of the previous example, a blog post representation must be completely independent of a blog post as a conceptual entity. A blog post as a conceptual entity can instead be associated with one or more representations, as opposed to being tightly coupled to a specific representation. This is commonly referred to as Separation of Concerns.

Another architecture paradigm and pattern that seeks the same purpose is the Model-View-Controller pattern. It was initially thought of and widely used for building desktop GUI applications, and now it's mainly used in web applications, thanks to popular web frameworks like Symfony, Zend Framework, and CodeIgniter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.76.89