Chapter 6. Layered Architecture: Separating Concerns

Image

What if your problem is simple and time is of the essence? Should you even bother with architecture? It depends on how long you want to keep what you build. If it’s disposable, throw caution to the wind. If not, then choose the simplest architecture that still provides some measurable organization and benefit, without imposing many constraints on speed of delivery. The layered architecture has become that architecture because it’s easy to understand and implement, leveraging design patterns developers already know. Let’s peel back the layers of this architecture.

Naan & Pop: Gathering requirements

Sangita likes simple meals, so she created an Indian-inspired mom-and-pop restaurant called Naan & Pop, specializing in flatbread sandwiches and sodas.

The restaurant needs a website where customers can place orders online. Since Naan & Pop is a startup with a small budget, it needs to be simple and created quickly.

Sangita has some specific requirements.

Image

Time to market

The restaurant is already open. The faster they can get the site online, the faster they can start making money. The site should be simple.

Image

Separation of responsibilities ...

Get Head First Software Architecture now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.