This page contains a prototype implementation of MetaDepth, supporting facet-oriented modelling, whose main ideas are in the following papers:
In order to experiment with the tool, you'll need Java 8 (at least) installed in your computer.
java -jar metaDepth.jar
// ) ) _ __ ___ __ ___ ___ // / / ___ ___ __ ___ / __ // ) ) ) ) //___) ) / / // ) ) // / / //___) ) // ) ) / / // ) ) // / / / / // / / // / / // / / // //___/ / / / // / / // / / / / ((____ / / ((___( ( //____/ / ((____ // / / // / / MetaDepth v0.3.MTL http://metadepth.org Top level command shell Tue Mar 17 11:18:40 CET 2020 >
Some examples can be found in this zip file. Please unzip the folder, and set MetaDepth's working directory to the example folder you want to work with. For example, to work with the employees folder, use the following command:
set DIR "[path]/employees/"
where [path] is your path to folder employees. Each example contains creation and facet meta-models, sample models, interfaces and facet laws. In addition, they contain executable files that can be run within the tool. For example, the file Pspec.mdc contains the following commands:
load "People" load "Employment" context Springfield addFacet homer work: Employment.Employee with { name = fullName [equality] salary = 12345 ssNumber = 555 } context Springfield dump
which simply loads the People and Employment meta-models (People.mdepth also contains a sample model named Springfield), adds a facet to object homer, and dumps the context of model Springfield.
You can run this file with command:
run Pspec
There you should see that homer has now the fields of an Employee filled as specified in the add command:
ext People Springfield{ ... @Facets(Employee) ext Person homer { address=SimpsonsHouse; fullName="Homer Simpson"; female=false; age=50; spouse=marge; @Facet(work, Employee) name="Homer Simpson"; @Facet(work, Employee) ssNumber=555; @Facet(work, Employee) salary=12345.0; } ... }
You can now for example change homer's fullName, and check that the field name of the work facet changes as well. You can do this using EOL as follows:
> # EOL :: entering eol execution mode > homer.fullName:="Homer Jay Simpson"; > # Warning: current context is $root, setting context to Springfield :: executing command
Where the lines starting by ">" are user inputs, and the others are metaDepth replies. By typing command dump, you should see the changes:
... ext People Springfield{ ... @Facets(Employee) ext Person homer { address=SimpsonsHouse; fullName="Homer Jay Simpson"; female=false; age=50; spouse=marge; @Facet(work, Employee) name="Homer Jay Simpson"; @Facet(work, Employee) ssNumber=555; @Facet(work, Employee) salary=12345.0; } ... }The examples zip file contains the following case studies: