-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more systematic approach to organising the megamodel examples
- Loading branch information
1 parent
2e39561
commit 3fce19a
Showing
14 changed files
with
143 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.back.megal | ||
*.dot | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
all: | ||
|
||
build: | ||
cp ../../../../../101repo/capabilities/Object_XML_mapping/MegaL/*.megal . | ||
|
||
clean: | ||
rm -f *.dot *.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
These megamodels are taken directly from the 101companies repository. | ||
They were available at this address: | ||
https://github.com/101companies/101repo/tree/master/capabilities/Object_XML_mapping/MegaL | ||
|
||
For more information on the project, look for: | ||
http://101companies.org/ | ||
|
||
Re-run 'make build' if you want to refresh the files — requires a cloned copy of the 101companies repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{- Object/XML mapping may be customized by some annotation mechanism such that schema-derived or authored OO types and their members are annotated with hints regarding de-/serialization. -} | ||
|
||
megamodel capabilities/Object_XML_mapping/annotation . | ||
|
||
include capabilities/Object_XML_mapping/serialization . | ||
include capabilities/Object_XML_mapping/deserialization . | ||
|
||
variable Language Annotation partOf OoLanguage . | ||
variable Language OxAnnotation subsetOf Annotation . | ||
variable Fragment+ anno partOf ooTypes . | ||
|
||
OxAnnotation partOf OxMapper . | ||
deserialize dependsOn anno . | ||
serialize dependsOn anno . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{- Configuration of Object/XML mapping may be achieved by designated configuration files. An additional or alternative form of configuration may be achieved by annotations, as discussed elsewhere. -} | ||
|
||
megamodel capabilities/Object_XML_mapping/configuration . | ||
|
||
include capabilities/Object_XML_mapping/values . | ||
|
||
variable Language OxConfiguration . | ||
variable File config elementOf OxConfiguration . | ||
|
||
OxConfiguration partOf OxMapper . | ||
deserialize dependsOn config . | ||
serialize dependsOn config . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{- This module describes the value-level aspect of specifically de-serialization. (There is a related module for specifically serialization. At the heart of this description is a function deserialize, which is somehow derived by the mapper from the XML types (or the corresponding OO types) such that deserialization may map an XML document to an object graph with the suitable correspondence and conformance relationships. -} | ||
|
||
megamodel capabilities/Object_XML_mapping/deserialization . | ||
|
||
include capabilities/Object_XML_mapping/values . | ||
|
||
local Function deserialize : XML -> ObjectGraphs . | ||
variable File xmlInputDoc elementOf XML . | ||
variable ObjectGraph intialObj elementOf ObjectGraphs . | ||
|
||
deserialize dependsOn OxMapper . | ||
deserialize dependsOn xmlTypes . | ||
xmlInputDoc conformsTo xmlTypes . | ||
finalObj conformsTo ooTypes . | ||
finalObj correspondsTo xmlInputDoc . | ||
deserialize(xmlInputDoc) |-> intialObj . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{- Arguably, the typical Object/XML mapping technology comes with a code generation component to derive OO types from XML types. Conceptually, though, this component is optional, which is why it is only introduced now. -} | ||
|
||
megamodel capabilities/Object_XML_mapping/generation . | ||
|
||
include capabilities/Object_XML_mapping/types . | ||
|
||
local Function generator : XmlSchemas -> MappableOo . | ||
|
||
generator partOf OxMapper. | ||
generator(xmlTypes) |-> ooTypes . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{- De-serialization was already discussed in a designated module, but the derivation of the corresponding function for de-serialization was not yet explained. To this end, we need to assume actual program code which makes use of appropriate library functionality to issue de-serialization. (There is a similar module for serialization.) -} | ||
|
||
megamodel capabilities/Object_XML_mapping/read . | ||
|
||
include capabilities/Object_XML_mapping/deserialization . | ||
|
||
variable File problemProgram elementOf OoLanguage . | ||
variable Fragment deserialization partOf problemProgram . | ||
|
||
problemProgram dependsOn ooTypes . | ||
deserialization realizationOf deserialize . | ||
deserialization dependsOn OxLibrary . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{- This module describes the value-level aspect of specifically serialization. (There is a related module for specifically de-serialization. At the heart of this description is a function serialize, which is somehow derived by the mapper from the XML types (or the corresponding OO types) such that serialization may map an object graph to an XML document with the suitable correspondence and conformance relationships. -} | ||
|
||
megamodel capabilities/Object_XML_mapping/serialization . | ||
|
||
include capabilities/Object_XML_mapping/values . | ||
|
||
local Function serialize : ObjectGraphs -> XML . | ||
variable File xmlOutputDoc elementOf XML . | ||
variable ObjectGraph finalObj elementOf ObjectGraphs . | ||
|
||
serialize dependsOn OxMapper . | ||
serialize dependsOn xmlTypes . | ||
xmlOutputDoc conformsTo xmlTypes . | ||
finalObj conformsTo ooTypes . | ||
finalObj correspondsTo xmlOutputDoc . | ||
serialize(finalObj) |-> xmlOutputDoc . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{- This is the basic module explaining the component structure and inter-language and technology dependencies for an Object/XML mapping technology. -} | ||
|
||
megamodel capabilities/Object_XML_mapping/technology . | ||
|
||
variable Technology OxMapper . -- the name for the technology | ||
variable Library OxLibrary . -- the assumed support library | ||
variable Language XmlSchemas . -- the targeted XML type system, e.g., XSD | ||
variable Language OoLanguage . -- the targeted OO language | ||
variable Language MappableOo . -- the OO subset used in mapping | ||
Language XML . -- XML as serialization format | ||
variable Language ObjectGraphs . -- object graphs in memory | ||
|
||
OxLibrary partOf OxMapper . | ||
OxMapper dependsOn XmlSchemas . | ||
OxMapper dependsOn OoLanguage . | ||
MappableOo subsetOf OoLanguage . | ||
MappableOo partOf OxMapper . | ||
OxMapper dependsOn XML . | ||
OxMapper dependsOn ObjectGraphs . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{- This module covers the essential type-level aspects of Object/XML mapping. In particular, the types in the spaces XMLware and the objectware are pointed as they correspond to each other. We also make explicit the existence of a problem-specific language underlying the involved type-level artifacts. We think of this language as being abstract in the sense of not fixing it here as being a set of XML trees or object graphs. -} | ||
|
||
megamodel capabilities/Object_XML_mapping/types . | ||
|
||
include capabilities/Object_XML_mapping/technology . | ||
|
||
variable File+ xmlTypes elementOf XmlSchemas . | ||
variable File+ ooTypes elementOf MappableOo . | ||
local Language problemLanguage . | ||
|
||
xmlTypes correspondsTo ooTypes . | ||
xmlTypes definitionOf problemLanguage . | ||
ooTypes definitionOf problemLanguage . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{- Serialization was already discussed in a designated module, but the derivation of the corresponding function for serialization was not yet explained. To this end, we need to assume actual program code which makes use of appropriate library functionality to issue serialization. (There is a similar module for de-serialization.) -} | ||
|
||
megamodel capabilities/Object_XML_mapping/write . | ||
|
||
include capabilities/Object_XML_mapping/serialization . | ||
|
||
variable File problemProgram elementOf OoLanguage . | ||
variable Fragment serialization partOf problemProgram . | ||
|
||
problemProgram dependsOn ooTypes . | ||
serialization realizationOf serialize . | ||
serialization dependsOn OxLibrary . |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters