Skip to main content

Generating and building the application code

Up to this point, we have only defined an abstract model using the Micro RadiantMicro Radiant (MicroRadiant). The graphical modeling IDE and tooling environment used to design, edit, and maintain NS applications and project models.. The true power of Normalized SystemsSystemA set of interconnected components that work together to achieve a specific purpose or function. lies in the subsequent step: code generation. The NS tooling, through its ExpandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact., translates all the constructs in your model, such as the Car and Booking Data ElementsData Element (DataElement). A fundamental data concept or entity within an application's domain, acting as an anthropomorphic translation of a real-life object or concept. 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 ElementData Element (DataElement). A fundamental data concept or entity within an application's domain, acting as an anthropomorphic translation of a real-life object or concept. automatically receives typical Create, Read, Update, and Delete ( CRUD) functionality via a generated Graphical User Interface (GUI).
  • Search/FindersFinderA search specification combining field-operator pairs to execute standard data queries on a DataElement.: All specified FinderFinderA search specification combining field-operator pairs to execute standard data queries on a DataElement. 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 anchorsAnchorA marker within generated source code reserved for adding custom logic during re-expansion. where developers can insert specific business logic or custom code (known as insertions and extensions). This allows for deep customization without compromising the systemSystemA set of interconnected components that work together to achieve a specific purpose or function.'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 RadiantMicro Radiant (MicroRadiant). The graphical modeling IDE and tooling environment used to design, edit, and maintain NS applications and project models., 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 ExpandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. 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 layersLayerLogical separation of functionality within a single system/application, focused on code organization.) required for a functional applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution.. 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 systemSystemA set of interconnected components that work together to achieve a specific purpose or function. (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.