Validation Package for our SEAA 2020 Paper on Deriving Microservice Code from Underspecified Domain Models Using DevOps-Enabled Modeling Languages and Model Transformations
The source code of the plugins for Phases 1 to 3 are part of this repository. They can be found here:
- Plugin covering Phases 1 (DDD domain to basic LEMMA domain models) and 2 (basic LEMMA domain to refined domain and new service models leveraging the approach described in Subsubsection III-B3 of the paper): de.fhdo.lemma.ddmm2lemma
- Plugin for Phase 3: de.fhdo.lemma.projections
- Code Generator: The code generator is part of the main LEMMA repository and can be found in its
model_processing
branch: https://github.com/SeelabFhdo/lemma/tree/model_processing/code generators
To reproduce the validation steps as described in Subsection IV-B of the paper, an Eclipse instance needs to be prepared first:
- Download the current release 2020-03 (4.15.0) of the Eclipse IDE for Java and DSL Developers.
- Unpack the downloaded Eclipse release, run it, and install the current Papyrus package from this update site: http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/2020-03.
- Install the current ATL package from this update site: https://download.eclipse.org/mmt/atl/updates/releases.
- Download the
dropins.zip
file from the Releases section of our GitHub Validation Package: https://github.com/SeelabFhdo/seaa2020/releases/download/v1/dropins.zip. The ZIP file contains the JAR archives of the LEMMA Eclipse plugins, as well as the JAR archives of thede.fhdo.lemma.ddmm2lemma
and thede.fhdo.lemma.projections
plugins (see above). - Restart the Eclipse instance.
For the actual reproduction, please follow these steps:
- Clone this repository to your harddrive.
- Import the
Cargo
andLakeside Mutual
Eclipse projects contained in the cloned Validation/Case Study Models and Code folder into a workspace of the prepared Eclipse instance. - To review the DDD domain models of Phase 1 imported by the previous step, switch to the
Cargo/Phase 1
orLakeside Mutual/Phase 1
folder in the Eclipse Package Explorer. Double click on thecargo.di
orLakesideMutual.di
file. In the opening Welcome window of Papyrus, click on theCargoDiagram
(Cargo) orClass Diagram
(Lakeside Mutual) link in the Notation Views section. The Cargo or Lakeside Mutual input DDD domain model used for validating our methodology is shown in Eclipse Papyrus. - To review the derived LEMMA models of Phase 2, switch to the
Cargo/Phase 2
orLakeside Mutual/Phase 2
folder in the Eclipse Package Explorer. Theextracted models
sub-folders contain the derived DevOps-related LEMMA models in their concrete (files with extensions.data
and.services
) and abstract (files with extension.xmi
) syntax representations. Files with theextracted_
-prefix are overwritten each time when a new derivation on the DDD domain models is executed.
LEMMA models directly contained in theextracted models
folder, e.g.,domain.data
andservice.services
, comprise all derived Bounded Contexts and enclosed domain concepts, and all derived microservices, respectively. LEMMA models contained in a sub-folder ofextracted models
only contain derived elements related to the Bounded Context with the same name as the nested folder, e.g.,Customer
for the Cargo case study's "Customer" andcity
for Lakeside Mutual "city" Bounded Context.
The DevOps-related LEMMA models may also be interactively derived leveraging our plugins within the prepared Eclipse instance. To this end, right click on either thecargo.uml
orLakesideMutual.uml
file in theCargo/Phase 1
orLakeside Mutual/Phase 1
folder in the Eclipse Package Explorer and hit the entryExtract Editable LEMMA Models
in the opening context menu. The Eclipse Handler DdmmToLemmaTransformationHandler from thede.fhdo.lemma.ddmm2lemma
plugin will be invoked to execute the M2M transformations of Phase 2 on the selected DDD domain model in the.uml
file. Next, the plugin leverages the Projections class of thede.fhdo.lemma.projections
plugin to extract the in-memory LEMMA models to their concrete syntax representations. After the extraction is finished, a message box will be displayed, which informs the modeler that the LEMMA models were successfully extracted. You can then find the extracted models in theCargo/extracted models
orLakeside Mutual/extracted models
folders in the Eclipse Package Explorer. The contents of the folders are identical to the contents of theCargo/Phase 2/extracted models
andLakeside Mutual/Phase 2/extracted models
sub-folders.
The plugins may also receive certain configuration options. These can be found in the running Eclipse instance within the menu atWindow > Preferences > DDMM2LEMMA Configuration
. The first option allows for exchanging the refining M2M transformation on LEMMA domain models based on the selected DevOps model derivation approach. By default, the configuration value points to this transformation. The second option allows for exchanging the DevOps derivation transformation for LEMMA service models. By default, the configuration value points to this transformation. The third option allows for changing the output path of the M2T extraction to something else thanextracted models
. - To review the adapted LEMMA models of Phase 3, navigate to the
Cargo/Phase 3
orLakeside Mutual/Phase 3
folders in the Eclipse Package Explorer. The contents of the folders were copied from theextracted models
folders derived in Phase 2. However, the files with theextracted_
-prefix were removed to improve clarity. Comments in the model files identify the places were adaptation actions took place (similarly to Listing 3 from the paper). - The mapping models for Phase 4 may be found in the
Cargo/Phase 4
orLakeside Mutual/Phase 4
folders in the Eclipse Package Explorer. The generated Java and Spring source code is contained in thegenerated code
sub-folders.
If you are interested in generating the Java and Spring code yourself, execute thegenerate_code.sh
Bash script in theCargo
orLakeside Mutual
folders cloned from the repository. They will execute the generator's standalone fat JAR from the cloned Validation/libs folder. For the generator to run, you need at least Java 12. To temporarily set your Java version to at least 12, you can adapt theexport_java_home.sh
Bash script in theCargo
orLakeside Mutual
folders. Please note that thegenerate_code.sh
Bash scripts also start the generated microservices at ports starting from 8080. If you only want to generate the code without the microservices to start, pass the "compile_only" option to the scripts.
In order to retrieve the numbers mentioned in the Validation subsection of the paper, review or execute the scripts from the cloned Validation/Analysis folder corresponding to the different phases of our methodology. For the majority of the scripts to run, you need Python 3 and the cloc
utility for automated LOC counting.