DEx : Generating Data Explorers
The Data Explorer is a generator aimed at demonstrating the power of the generative software development methodology using the generator framework MontiCore. It is based on the modeling language CD4Analysis. It demonstrates the easy-to-use generation of raw but ready-to-use business applications from abstract models, without having to write a single line of application code. It also demonstrates how to effectively adapt the generator or extend the generated product if needed. The generated applications provide a graphical user interface to manage instances of the modeled system. Furthermore, they allow to persist instances in the cloud and share them among users of the applications. The list of Data Explorer features includes among others:
- Frontend features:
- Object management (create, read, update, delete)
- Search and filter functionality
- Display of type hierarchies
- Management of associations
- Feedback on invalid input
- Support for Java types (e.g. List<Integer>, Date)
- Generated dummy values for testing
- Backend Features:
- Multiuser database storage
- Integration of handwritten code
In a nutshell
- Install the Java Development Kit (JDK) 8 or higher.
- Download the DEx generator distribution file, unzip it, and change to the extracted directory.
|Running the DEx Generator
- Execute the DEx generator on the provided CD4Analysis model ‹SocNet.cd›.
|Compiling the Generated Product
- Compile all the generated Java source files.
|Running the Generated Product
- Execute the generated product as Java application.
- Install the latest JDK (at least version 8 required).
- Make sure the environment variable JAVA_HOME points to the installed JDK, NOT the JRE (e.g. ‹/usr/lib/jvm/java-8-openjdk› on UNIX or ‹C:\Program Files\Java\jdk1.8.0_40› on Windows). You will need this in order to run the Java compiler for compiling the generated Java source files; see here for more information.
- Download the DEx generator zip distribution file.
- Unzip the distribution. It will unzip a directory called ‹dex-cli› (short for DEx Command Line Interface) containing the application JAR along with a directory called ‹examples› containing an example class diagram.
Run the DEx Generator
- Open a command line interface and go to the unzipped DEx root directory ‹dex-cli›.
- The distribution contains an example class diagram; execute the DEx generator by running:
‹java -jar dex-cli.jar examples/SocNet.cd›
- A dialog box will pop up (twice) and ask for your consent to report some abstract usage statistics. We would like to collect general information to learn more about how to improve DEx. No direct positive/negative implications will apply. Click ‹yes› if you want to help us.
- The DEx generator will be launched and the following steps will be executed:
- The model will be parsed and analyzed by the DEx tool.
- Java code of a corresponding DEx application will be generated into the default output directory ‹out›.
- In addition the DEx runtime jar ‹dex-rte.jar› and a product logging configuration ‹logback.xml› required for the execution of the product are copied to the output directory.
- The output directory will also contain detailed reports in a sub directory ‹reporting› and a log file of the executed generation process ‹dex.gtr.YYYY-MM-DD-HHmmss.log›.
Compile and run the Generated Product
- Compiling the application
- Change into the output directory (by default ‹out›) and execute the command:
‹javac -cp dex-rte.jar -sourcepath . dex/socnet/Main.java›.
- This will compile all classes of the generated DEx product located in the output directory.
- Running the application
- Execute the command in order to start the generated product:
‹java -cp ".;dex-rte.jar" dex.socnet.Main›.
- (Optional) If you are using Linux or Mac OS X, execute the following command instead:
‹java -cp ".:dex-rte.jar" dex.socnet.Main›.
- This will run the generated DEx product. The product will write log messages into the file ‹dex.product-YYYY-MM-DD-HHmmss.log›
- In the dialog you can select to work online or offline:
- Choose ‹Demo Access›, if you don't want to register yet but like to use persistent database storage.
- Choose ‹Offline›, if you don't want to register yet and don't need persistent database storage.
The shipped example class diagram (‹examples/dex/SocNet.cd›) can be used as a starting point. Feel free to alter it / to model your own diagram (using the textual CD4Analysis class diagram language) and rerun the DEx generator as described above.
- If an error occurs and you cannot solve the problem you may take a look into the DEx log file located in the respectively specified output directory (e.g. ‹out/dex.gtr-YYYY-MM-DD-HHmmss.log› by default). It contains more verbose and developer oriented, technical output than the CLI output.
- Please report any unknown issues to this address. Please include the processed model and the log file.