Introduction


DeltaJava is a powerful delta-oriented programming language, designed to comfortably create Software Product Lines within the Java environment. The DeltaJava project is implemented in form of a set of Eclipse plug-ins.

The approach of Delta-Oriented Programming (DOP) enables the mighty ability to add, remove or even modify code fragments from a given base product. Picture 1 depicts an example of how to conceptually derive a variant (right side) from a base product (left side) where fragment A is modified, B removed, D added and C untouched.

Herefore, DeltaJava offers various operations and units to contain them in. For references, see our syntax section.

Delta-Oriented Programming

Picture 1: Altering a Software Product using Delta-Oriented Programming.



How does it work?


DeltaJava was built with EMFText - "an Eclipse plug-in that allows you to define text syntax for languages described by an Ecore metamodel".
Its delta modules provide a convenient, Java-like way to add, modify and remove Java code as demonstrated in the syntax section.

DeltaJava's architectural base is an EMFText implementation of Java, called JaMoPP (Java Model Printer and Parser) which enables to write native Java code inside DeltaJava's delta modules. DeltaJava defines its operations and units on top of JaMoPP by wrapping the JaMoPP Java code inside them.

As backbone for its variant generation and problem space artifacts, DeltaJava relies on DeltaEcore. For that purpose, the DeltaJava implementation contains a special DeltaEcore dialect for Java (based on JaMoPP). When saving DeltaJava delta modules, DeltaJava will therefore transform its saved delta modules to equivalent DeltaEcore delta modules, using that dialect.

When it comes to problem space artifacts in DeltaJava projects, DeltaEcore feature models offer a convenient, graphical editor for the organization and configuration of variants. A feature mapping is then used to simply map feature selection conditions to appropriate DeltaEcore delta modules (which were automatically generated from DeltaJava delta modules).

Finally, to generate variants from a DeltaJava software product line, the DeltaEcore feature model offers the ability to chose a set of features and thereupon automatically derive a variant.

DeltaJava how-does-it-work

Picture 2: DeltaJava and DeltaEcore artifacts for a minimal DeltaJava project setup and how they interact.

Pre-packed installations


Eclipse 2020-12: DeltaJava

Pre-packed Eclipse 2020-12 installation with DeltaJava ready to use.

Windows 64-bit Linux 64-bit
Eclipse 2020-12: DeltaJava & DarwinSPL

Pre-packed Eclipse 2020-12 installation with DeltaJava and DarwinSPL (evolution-aware feature modeling) ready to use.

Windows 64-bit Linux 64-bit

Installation from Update Site


To install new software to your Eclipse runtime, select "Help" and search for the "Install new Software..." entry. screenshots/screenshot_install_software.jpg Copy the respective URL, add it as location and install the components you wish.

Installation from Source Code


As shown in the section about DeltaJava's structure, its plug-in projects are build upon each other. Hence, to check out DeltaJava from source code, you will need multiple Eclipse runtimes launching each other.

Unfortunately, in order to install DeltaJava by source code, you will need two seperate eclipse installations with different versions of EMFText installed. Hence, as first step, please download a fresh Eclipse Installation from the official Eclipse Packages Download Site or reuse an installation that does not have EMFText installed yet.

  • Download the "Eclipse Modeling Tools" package from the official Eclipse Packages Download Site. screenshots/screenshot_eclipse_download.jpg
  • Unzip the contained "eclipse" folder into a directory of your choice (preferably empty). screenshots/screenshot_eclipse_unzip.jpg
  • Start the eclipse installation.
  • Choose a workspace: Call the folder you choose to be your workspace "DeltaJava-Runtime1" as it is the workspace folder for this instance. screenshots/screenshot_workspace1.jpg Please remember the location of your workspace folder, you will need it later.
  • Install an SVN client: Therefore, open the Eclipse Marketplace ("Help" → "Eclipse Marketplace"). screenshots/screenshot_eclipse_marketplace.jpg
  • Search for "Subversive" and install the "Subversive SVN Team Provider" by following the opening dialog. screenshots/screenshot_install_svn.jpg
  • Restart Eclipse.
  • Install an SVN Connector: Therefore, open the preferences page ("Window" → "Preferences"). screenshots/screenshot_eclipse_preferences.jpg
  • Navigate to "Team" → "SVN" → "SVN Connector" → "get SVN Connector". screenshots/screenshot_svn_connector.jpg
  • Follow the dialog to install your preferred connector. screenshots/screenshot_svn_connector2.jpg
  • Exit Eclipse, do not restart it.
  • Now that you have an up-to-date Eclipse installation with Ecore preinstalled (comes along with the "Eclipse Modeling Tools" package) and SVN plugins freshly set up, use your system explorer to navigate to the folder that contains the eclipse installation folder. screenshots/screenshot_eclipse_root_0.jpg
  • Duplicate that folder and rename the copy to "eclipse-emftext-trunk". screenshots/screenshot_eclipse_root_1.jpg This Eclipse installation will be needed to install DeltaEcore which depends on the latest version of EMFText.
  • Open your copied folder "eclipse-emftext-trunk" and run the contained eclipse executable.
  • Choose the same workspace as before ("DeltaJava-Runtime1"). screenshots/screenshot_workspace1.jpg
  • As soon as Eclipse is launched, select "Help" and search for the "Install new Software..." entry. screenshots/screenshot_install_software.jpg
  • In the opening dialog, paste the link below into the text field that is selected by default and install EMFText. screenshots/screenshot_install_emftext_trunk.jpg
     Copy
  • Restart Eclipse.
  • Check out all projects from the SVN Repository folder linked below. screenshots/screenshot_import_svn.jpg Please make sure to choose the "Find projects in the children of the selected resource" option. screenshots/screenshot_checkout_deltaecore_framework.jpg For the sake of clarity, it might be desirable to check out DeltaEcore into a designated Working Set within your workspace.
     Copy
  • Next, also check out all projects from the SVN Repository folder linked below. The repository contains necessary utility code for DeltaEcore. Please proceed as before.
     Copy
  • Press the Alt, Shift and G Buttons simultaniously to open a dialog where you then select all displayed Ecore meta models and confirm by clicking "Next".
  • Only select the boxes underneath "Model" except for the project "org.deltaecore.feature" which also needs the "Edit" and "Editor" code to be generated. screenshots/screenshot_generate_code_decore.jpg
  • Confirm your selection by clicking "Finish". Code will now be generated.
  • Use the Eclipse search function to search for files ending on the file extension cs by entering "*.cs" in the "File name pattern" textfield. screenshots/screenshot_install_deltaecore_cs_search.jpg
  • Go through the results, open the context menu on each entry and hit "Generate text resources". screenshots/screenshot_deltaecore_cs_generation.jpg Additional projects and classes will be generated into your workspace; a little patience is required.
  • Close following projects:
    • de.ovgu.featureide.deltaecore (This project is a composer for FeatureIDE; "an Eclipse-based IDE that supports all phases of feature-oriented software development for the development of SPLs")
    • org.deltaecore
    • org.deltaecore.installer
    • org.deltaecore.integration.ie.feature.eclipse
    • org.deltaecore.integration.ie.feature.featureide
  • DeltaEcore should now be successfully installed; your workspace should not contain any errors. You are finished with the installation of DeltaEcore and can now exit your eclipse instance.
  • In contrast to installing/working with DeltaEcore, working with JaMoPP (and therefore DeltaJava) requires an older version of EMFText. Hence, in the next steps of this installation guide, you are going to set up another Eclipse installation with an EMFText version older than "trunk". Similar to how we set up the Eclipse installation for the EMFText trunk version, you are now going to set up an installation with EMFText's release version (older) installed. Therefore, use your system explorer to navigate to the folder that contains both eclipse installation folders. screenshots/screenshot_eclipse_root_1.jpg
  • Duplicate the folder "eclipse" (the one that does not have EMFText installed) and rename the copy to "eclipse-emftext-release". screenshots/screenshot_eclipse_root_2.jpg From now on you are only going to work with the Eclipse installation you are about to set up.
  • Open your copied folder "eclipse-emftext-release" and run the contained eclipse executable; SVN and a connector should be installed, but no EMFText.
  • Choose the same workspace as before ("DeltaJava-Runtime1")
  • Don't worry about any errors in your workspace, they will disappear as soon as Eclipse is set up. as before, select "Help" and search for the "Install new Software..." entry. screenshots/screenshot_install_software.jpg
  • In the opening dialog, paste the link below into the text field that is selected by default and install only EMFText, especially not JaMoPP. screenshots/screenshot_install_emftext_release.jpg
     Copy
  • Restart Eclipse.
  • As next step, please import the JaMoPP projects to your workspace from the URL below. Therefore, you can use the preinstalled "EGit" Git client for Eclipse. screenshots/screenshot_import_svn.jpg
     Copy
  • Click your way through the upcoming dialogs. Make sure to select "Import existing Eclipse projects". screenshots/screenshot_import_git.jpg
  • Eclipse will search for plug-ins to import and eventually come up with a selection that contains many plug-ins you will not need for DeltaJava. Hence, please select the following plug-ins only (again, it is useful to create a new, designated Workig Set for JaMoPP): screenshots/screenshot_import_git.jpg
    • org.emftext.language.java
    • org.emftext.language.java.resource
    • org.emftext.language.java.resource.bcel
    • org.emftext.language.java.resource.java
    • org.emftext.language.java.resource.java.ui
    • org.emftext.language.java.resource.jdt
  • Open the org.emftext.language.java project, navigate to its "metamodel" folder, open "java.genmodel" with the "EMF Generator" editor (opens by default) and generate model code. screenshots/screenshot_generate_code_jamopp.jpg
  • Next, search for "java.cs" in the same folder, open the context menu on it and hit "Generate Text Resource". screenshots/screenshot_generate_code_jamopp2.jpg
  • Now your workspace should contain one single error. The cause for this is incorrectly generated code by EMFText which was fixed in a later version. However, since JaMoPP requires the older (release-) version, you have to deal with this error manually. Therefore, navigate to the troubling line of code (you can use the Problem View for this) and apply the quick fix Eclipse suggests. screenshots/screenshot_install_jamopp_quickfix.jpg JaMoPP is now set up.
  • Please import the two projects from following SVN repository location (username: anon):
     Copy
    This time, you dont't need to generate or fix anything. Your workspace should now contain DeltaEcore, JaMoPP and two DeltaJava base plug-ins (optimally in their respective working sets) screenshots/screenshot_instance1_finished.jpg
  • With your workspace set up, you now want to launch a new Eclipse runtime that uses all imported plug-ins. Therefore, open the Run Configurations Menu. screenshots/screenshot_run_configuration1.jpg
  • Right click on "Eclipse Application" to open the context menu and select "New Configuration" (or simply double click). screenshots/screenshot_run_configuration2.jpg
  • In the opening configuration menu, name your runtime "DeltaJaMoPP Runtime" and change the last segement of its location to "DeltaJava-Runtime2". Afterwards, you can start your freshly set up Eclipse runtime by hitting "Run" screenshots/screenshot_run_configuration3.jpg - from now on, Eclipse will remember the runtime you just set up, it is startable via the Eclipse Java perspective's green play button. screenshots/screenshot_run_configuration4.jpg

This runtime has all plug-ins installed which you checked out and set up in the prior installation guide steps. Here, you can use JaMoPP as Java Editor as well as Delta Ecore to implement a custom delta dialect for code generation.
As next step, you are going to check out a custom delta dialect for JaMoPP which builds the base for DeltaJava.

  • Please import the two projects from following SVN repository location (username: anon):
     Copy
  • Open the project de.tu_bs.cs.isf.deltajamopp, search for the folder "dialect", right click on its contained file "deltajamopp.decoredialect" and run it as "deltadialect Application". screenshots/screenshot_generate_decore.jpg
  • After completing these steps, your workspace should not contain any errors. You can now proceed with launching the third runtime similar to how you launched this one. For the sake of clarity, you should set up your third runtime's workspace you be named "DeltaJava-Runtime3". screenshots/screenshot_deltajamopp_launch_new_runtime.jpg
  • Please start the third runtime.

This runtime hosts the DeltaJava plug-ins which build upon the underlaying DeltaEcore framework and JaMoPP functionality.

  • Please check out all projects from following SVN repository location (username: anon):
     Copy
  • Open the project de.tu_bs.cs.isf.deltaj, search for the folder "metamodel" and open "deltaj.genmodel". Now generate the model code as done in prior installation guide steps. screenshots/screenshot_generate_deltaj_model_code.jpg
  • Open the context menu on "deltaj.cs" and hit "Generate Text Resource". screenshots/screenshot_generate_deltaj_text_resource.jpg A new project will be generated into your workspace.
  • The plug-in de.ovgu.featureide.deltajava is a composer for FeatureIDE; "an Eclipse-based IDE that supports all phases of feature-oriented software development for the development of SPLs" - you can close this project if you did not install FeatureIDE to avoid errors in your workspace.
  • To fix all remaining errors with the EMFText generated code within your workspace, please search for a small red delta icon within the Eclipse tool bar. screenshots/screenshot_fix_deltaj_util.jpg Clicking it will rewrite some code and plug-in settings and fix all problems. This might take a while. If the tool is not available in your tool bar, please make sure the de.tu_bs.cs.isf.deltaj.utility project was checked out into your second runtime's workspace.
  • Please start the 4th runtime now, using the same workflow as before.

In this runtime, you can now use DeltaJava to implement software product lines.

A toy example to get a first impression of DeltaJava can be found in our section Getting Started.

Getting Started


The "DeltaTalk" toy example

In this section, we provide an easy to grasp toy example to get started with DeltaJava; the very simple Chat GUI "DeltaTalk". The project consists of a small collection of delta modules along with an even smaller base of core Java assets. To get an overview of the entire DeltaJava syntax and the possibilites it offers, please refer to our syntax section.

Please check out the de.tu_bs.cs.isf.deltatalk project from the SVN repository location given below (username: anon). screenshots/screenshot_import_deltatalk.jpg Make sure to choose the "Find projects in the children of the selected resource" option while checking out.

 Copy

After checking out DeltaTalk, you might need to rebuild your workspace. screenshots/screenshot_rebuild_deltatalk.jpg

In DeltaJava, all delta modules are contained inside a designated delta folder. For the "de.tu_bs.cs.isf.deltatalk" project, this folder is simply named "deltas/". When applied, its contained delta modules add, modify and/or remove functionality of the project's source folder's core assets. In our particular DeltaTalk example, the core assets' source files implement a fairly simple GUI. You can go ahead and start the project as Java application. screenshots/screenshot_deltatalk_core.jpg

The DeltaTalk example works with DeltaEcore to organize its problem space artefacts which - for this project - are a feature model and delta mapping. To generate variants from the DeltaTalk SPL, open its feature model ("DeltaTalk.defeaturemodel") with the "Feature Model Configurator (DeltaEcore)" editor. screenshots/screenshot_deltatalk_featuremodel.jpg Using this editor, you can select (one or more) feature(s) generate variants accordingly by pressing the "Generate Variant" button. screenshots/screenshot_deltatalk_featuremodel_generate.jpg

A pop-up window will open and ask you to select a generator along with a directory to generate the variant in. screenshots/screenshot_deltatalk_featuremodel_generate_popup.jpg Generally, we recommend you to generate variants into a designated eclipse project (e.g. "de.tu_bs.cs.isf.deltatalk.variant"). Pressing the OK button will trigger DeltaEcore's variant generation for your selected feature; respective delta modules will be applied. You can test your generated variant by starting the variant project as Java application. screenshots/screenshot_deltatalk_emotebutton.jpg

Feel free to change delta modules and play around with DeltaTalk to get a taste of how the variant generation works. For more information about DeltaEcore, visit deltaecore.org.



Basic DeltaJava Tutorial

This Tutorial gives an insight into the basic usage of DeltaJava.

Syntax


This section introduces DeltaJavas syntax and illustrates its operations and functionality with the help of easy to grasp examples.

Publications


DeltaJ 1.5: delta-oriented programming for Java 1.5

Delta-oriented programming (DOP) is a modular, yet flexible approach to implement software product lines. In DOP, a product line is implemented by a set of deltas, which are containers of modifications to a program ...

Download
Compositional type checking of delta-oriented software product lines

Delta-oriented programming is a compositional approach to flexibly implementing software product lines. A product line is represented by a code base and a product line declaration. The code base ...

Download
Refactoring delta-oriented software product lines

Delta-oriented programming (DOP) is an implementation approach to develop software product lines (SPL). Delta-oriented SPLs evolve over time due to new or changed requirements and need to be maintained to ...

Download
Family-based analysis of type safety for delta-oriented software product lines

Delta-oriented programming (DOP) is a modular, yet flexible approach for implementing software product lines extending feature-oriented programming ...

Download
Compositional type-checking of delta-oriented programming

Delta-oriented programming is a compositional approach to flexibly implementing software product lines. A product line is represented by a code base ...

Download
Pure delta-oriented programming

Delta-oriented programming (DOP) is a modular approach for implementing software product lines. Delta modules generalize feature modules by allowing removal of functionality. However, DOP requires to select one ...

Download
Delta-oriented programming of software product lines

Feature-oriented programming (FOP) implements software product lines by composition of feature modules. It relies on the principles of stepwise development. Feature modules are ...

Download