O'Reilly logo

Design Patterns and Best Practices in Java by Lucian-Paul Torje, Adrian Ianculescu, Kamalmeet Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Layered architecture with an example

To understand the layered architecture style further, let's take a look at the code and design example. Let's take a very simple requirement, where we need to get a list of employees from a database.

First of all, let's try to visualize the requirement in terms of layers by looking at this diagram:

We have created four layers, in this case. The presentation layer can be thought of as a simple HTML with JavaScript. You may want to use sophisticated frameworks, such as ReactJS or AngularJS, to keep things organized at the presentation layer, but in this example we have a simple presentation layer, where, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required