The following are instructions to replicate the case study in the CBSE 2014 submission "Runtime Modularity in Complex Structures: A Component Model for Fine Grained Runtime Adaptation".

Note that all of this code (or equivalent) is available in the latest Dana release, but this package contains a fixed version of it which works exactly as described in the paper.

 - ------------------------------ -
 - ------------------------------ -

You will need:

Dana 135.135.48

Prerequisites:

This code only works on Windows (at the time of writing).

We assume you've followed the installation instructions of Dana itself and have extracted this zip file somewhere. If you have a newer version of Dana already installed, you'll need to make sure that your system path variables refer to the directory of the above Dana version (i.e. for DANA_HOME and for the general "Path" variable on Windows).

None of the code that you will run has the capability to modify, create or delete any files; file usage is purely read-only. In the below procedures there's nothing you can do that can cause any damage (by accident or otherwise).

 - ------------------------------ -
 - ------------------------------ -

Running the demos

Open a command prompt within the extracted folder "source_code". You'll need to compile every Dana component file in this folder and in the "ui" sub-folder, using commands of the form "dnc GApp.dn". You'll also need every component in Dana's central source tree (i.e. within the subfolders of the "components" directory of dana's installation directory) to be compiled.

There are two suggested demo modes to try out involving the example application. If you're short of time you'll want to skip straight to #2.

 >>>> 1. Incremental

The idea of this demo is to show incremental dependency resolution among dynamically loaded components. You will manually configure an application in real-time from startup to full functionality.

To begin, issue the command:

dana esher

We'll be adding other components to the running system to incrementally resolve dependencies. The order in which this is done here is the "most interesting" order; any other order is equally valid.

We start with:

add conf/appfb.txt

This adds the application component to the system. Its component is loaded, the provided object type "App" is dynamically found, and its "main" function is invoked. The main method runs as far as it can get until it invokes a function on one of its (as yet) unsatisfied dependencies.

Now we do:

add conf/window.txt

This satisfies the application's Window dependency.

Now:

add conf/title.txt

add conf/colorbutton.txt

add conf/sys_info.txt

A window with a title bar appears and you can use that title bar to drag the window around.

At this point try using the command:

pa

This displays the current component population and their architecture / missing dependencies (with [x]).

The remaining commands that will complete the picture are:

add conf/button.txt

add conf/browser.txt

add conf/fs.txt

add conf/filego.txt

add conf/glviewer.txt

add conf/stringutil.txt


 >>>> 2. Immediate

The idea of this demo is to quickly run the case study application and then manually issue runtime adaptation commands.

Issue the command: dana esher conf_filebrowser.txt

This will launch the case study application fully configured and ready to go. Try clicking on its buttons, dragging it around with the title bar etc.

Now you can use the command prompt to further issue runtime adaptation instructions based on dependency substitution.

For example, issue the command:

add conf/buttonb.txt

Followed by:

tra App Button rsrc:conf/buttonb.txt

This substitutes the application component's dependency on the "Button" object type to use this alternative implementing component. The different implementation is represented simply by one that uses a different colour for the button and adds a drop shadow effect.

You can switch back to the previous button implementation with:

tra App Button rsrc:conf/button.txt

(note that these commands are all case-sensitive)


 - ------------------------------ -
 - ------------------------------ -

Finally, please be aware that Dana is a research prototype and a work in progress. Its core mechanics are robustly implemented but there will be bugs here and there! :-)