Skip to main content

Generating and building the application code

Up to this point, we have only defined an abstract model using the Micro Radiant. The true power of Normalized Systems lies in the subsequent step: code generation. The NS tooling, through its Expanders, translates all the constructs in your model, such as the Car and Booking Data Elements and the BookingFlow Workflow, into tangible, evolvable source code, typically written in Java (JEE).

Out-of-the-box functionalities

Once the elements are defined, the NS code generation process provides significant functionality with no manual coding required:

  • CRUD Operations: Every defined Data Element automatically receives typical Create, Read, Update, and Delete ( CRUD) functionality via a generated Graphical User Interface (GUI).
  • Search/Finders: All specified Finder methods (like findByBrandLk) are incorporated into the user interface.
  • Workflow Engine: A state transition logic and state tracking engine for every defined Workflow is automatically implemented.

The generated code also includes anchors where developers can insert specific business logic or custom code (known as insertions and extensions). This allows for deep customization without compromising the system's underlying evolvability. This topic will be handled in subsequent tutorials.

Expanding and compiling the project

The generation process involves two distinct steps: expansion (generating source code) and packaging (compiling the code).

Step 1: Expand the model

  1. In the Micro Radiant, click the Build button in the left-hand menu.
  2. Locate the menu on the right and select the Expansion tab.
  3. Execute the expand command.

This process utilizes the Expanders to read the NS model and generate the source code for the project, creating all the necessary files and folders (e.g., Java objects, persistence layers) required for a functional application. As a result, a directory expansions should be visible that includes the generated (Java) code.

Step 2: Package the application

  1. Remain in the Build menu and select the Build tab.
  2. Execute the package command.

This command triggers the underlying build system (e.g., Maven) to compile the generated Java project and assemble it into a deployable archive file (a .ear file).

If the build is successful, a new directory named target will appear in your euRent directory, containing the compiled and packaged Java code.