... | @@ -28,7 +28,13 @@ overview of the Generator's architecture: |
... | @@ -28,7 +28,13 @@ overview of the Generator's architecture: |
|
.The coarse-scale architecture of the Generator
|
|
.The coarse-scale architecture of the Generator
|
|
image::architecture.png[width=90%, align=center, link={imagesdir}/architecture.png]
|
|
image::architecture.png[width=90%, align=center, link={imagesdir}/architecture.png]
|
|
|
|
|
|
== The Scala _Abstract class representation_
|
|
NOTE: as the CLI part of the _Generator_ just means parsing the parameters and setting up the
|
|
|
|
configuration data for the _Generator_ accordingly, these steps are not discussed here any further.
|
|
|
|
Consult the corresponding Scaladoc and
|
|
|
|
link:/cwerner/code_generator/blob/master/src/main/scala/org/rosi_project/model_sync/generator/CLIGenerator.scala[source code]
|
|
|
|
for details.
|
|
|
|
|
|
|
|
== The Scala _Abstract class representation_ [[acr]]
|
|
|
|
|
|
The _Abstract class representation_ (ACR) is the hearth of the Generator. It forms the meta-model
|
|
The _Abstract class representation_ (ACR) is the hearth of the Generator. It forms the meta-model
|
|
for the code to generate and provides facilities to adapt model instances for different purposes.
|
|
for the code to generate and provides facilities to adapt model instances for different purposes.
|
... | @@ -98,12 +104,15 @@ cumbersome creation of the actual method statements is hidden within the class i |
... | @@ -98,12 +104,15 @@ cumbersome creation of the actual method statements is hidden within the class i |
|
|
|
|
|
== Working with models
|
|
== Working with models
|
|
|
|
|
|
IMPORTANT: a general introduction should be added
|
|
The __Generator__'s goal is to transform a synchronization model into a _JAR_ file which may than
|
|
|
|
be loaded, displayed and modified by the _Synchronization UI_. In order to do so, the _Generator_
|
|
|
|
creates a `SModel` which is a simple abstraction of such a model. It contains all classes as
|
|
|
|
instances of the <<acr, ACR>>.
|
|
|
|
|
|
=== Incremental construction of `SModel` instances
|
|
=== Incremental construction of `SModel` instances
|
|
|
|
|
|
Adding new classes to an `SModel` instance is pretty straightforward: its default implementation
|
|
Adding new classes to an `SModel` instance is pretty straightforward: its default implementation
|
|
(`SimpleSModel`) already provides a `addModelClass(clazz)` method.
|
|
(`SimpleSModel`) already provides an `addModelClass(clazz)` method.
|
|
|
|
|
|
However one often encouters the issue of some kind of cyclic reference in a model, i.e. a class `C0`
|
|
However one often encouters the issue of some kind of cyclic reference in a model, i.e. a class `C0`
|
|
referencing other classes `C1, ... Cn` which in turn keep references until one of these references
|
|
referencing other classes `C1, ... Cn` which in turn keep references until one of these references
|
... | @@ -191,11 +200,10 @@ The necessary preparations will be carried out through the visitors mentioned in |
... | @@ -191,11 +200,10 @@ The necessary preparations will be carried out through the visitors mentioned in |
|
modifications specific to synchronization. It is important to run the general visitor first to
|
|
modifications specific to synchronization. It is important to run the general visitor first to
|
|
ensure that all classes contain setter methods. These will than be augmented by the second visitor.
|
|
ensure that all classes contain setter methods. These will than be augmented by the second visitor.
|
|
|
|
|
|
WARNING: The Synchronization demo also expects some configuration classes for the model (namely
|
|
WARNING: In order to integrate models into the Synchronization demo, configuration classes are
|
|
`DisplayableModel` instances for the models as well as a `ModelSyncProvider`). These are currently
|
|
necessary. The Generator does currently not create those, as they need application specific
|
|
not generated automatically. Thus they need to be added to the JAR manually.
|
|
knowledge. At some point in the future this information may supplied as
|
|
|
|
https://www.eclipse.org/atl/[ATL] files.
|
|
NOTE: Generating these classes is currently being worked on.
|
|
|
|
|
|
|
|
== Writing to the File system [[compilation]]
|
|
== Writing to the File system [[compilation]]
|
|
|
|
|
... | | ... | |