Layered architecture

One of the core design aims is Separation of Concerns (SoC). One of the good practices, irrespective of the size of an application or microservice, is to create a layered architecture.

Each layer in a layered architecture has one concern, and it should implement it well. Layering the applications also helps in simplifying unit tests. The code in each layer can be completely unit tested by mocking out the following layer. The following figure shows some of the important layers in a typical microservice/web application:

The layers shown in the previous diagram are as follows:

  • Presentation layer: In a microservice, the presentation ...

Get Mastering Spring 5.0 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.