2.3 Application Structure

Getting familiar with the application.

Code Structure

The application in this lab is structured as follows:

  • monolith-application: Base directory for code or artifacts belonging to the application container
  • monolith-application/src/main/docker: Dockerfiles to build application and container
  • monolith-application/src/main/java/ch/puzzle/mm/monolith/: Location where most of the java application code resides
  • monolith-application/src/main/resources/db: contains the database migration scripts

The java code is structured by domains and the sub folders boundary, control and entity. Beside domains there are also helpers. For example the package monkey which contains a basic ChaosMonkey to inject errors.

Domains

In the application we have the following domains:

  • article: Static article management
  • order: Handles the management of the order and initiates the stock management
  • stock: Represents a stock management and handles the amount of items in stock

The most important classes in the application are:

  • order/boundary/ShopOrderResource.java: Provides the RESTful API endpoint for creating a new order
  • order/control/ShopOrderService.java: Handles the effective creation of the order and triggers the stock management
  • stock/control/ArticleStockService.java: Handles the effective management of the items in stock

Task 2.3.1 - Inspecting application structure

  • Have a look at the /code/monolith folder and get familiar with the application structure.