Unlike a Monolithic pattern, a layered pattern is where the entire software is broken down into discrete units or tiers based on their functional properties–which are usually the basic layers as seen in the previous lesson (presentation layer, application layer, business logic layer, data access layer).
For example, let’s say you want to visit Mindspace. You’d use a client like your desktop browser or a mobile browser to send a request for
mindspace.arclind.com. And when a Mindspace server gets this request, it looks for the page you want and responds with that information back to your client.
But if you were to follow the request and response, the flow would be like this!
- User/client requests Presentation layer
- Presentation layer requests Application layer
- Application layer requests Business layer
- Business layer requests Database layer
- Database layer responds Business layer
- Business layer responds Application layer
- Application layer responds Presentation layer
- Presentation layer responds User/client
Now this way, you can see that there is a good share of modularity, organisation, cohesion, decoupling, isolation, reusability, and flexibility between the software components. Multitier architecture also encourages better discipline and makes it very convenient for collaborations by simplifying code maintenance without any complexities tangling the stack.
The layered architecture is a common practice in a client-server model. Most modern applications have at least three layers when a database is involved. Hence this architectural pattern is also called as a three-tier or n-tier architecture.