Getting Familiar with the Monolith Code

Now let’s look at the code behind this monolith solution. We won’t devote too much time to the monolith code since we’re moving away from it, but it’s helpful to have a bit more context and detail about the application that we’re moving away from. This solution is built with Java, but the concepts here are similar to the patterns that appear in most monoliths.

To explore the code, you must first re-open the Cloud9 service in the AWS console. Once you open the Cloud9, select the “Serverless SaaS Workshop IDE” that listed as one of the environments. Open this environment by selected the “Open IDE” button.

Now, expand the list of folders in the left-hand pane drilling into the “lab 1” folder. In that folder under “server” you’ll find the “src” folder that holds the source code for our monolith. The main folders of our application are show in the following image:

Getting Familiar with the Code - Figure 1

The controller folder holds the code that represents the API entry points into your business services. There are also domain objects that hold the representation of our data as it moves through the system. The repository folder holds the code needed to store and retrieve products and orders from the database. The service folder holds the actual business rules and implementation of our services.