Using two models in a single project [message #719366] |
Fri, 26 August 2011 16:19  |
Eclipse User |
|
|
|
Hi Guys,
Would anyone tell me how can I instantiate two models within a single project. example:
Model 1 (Conceptual Diagram):
@namespace(uri="diagramConceptual", prefix="diagramConceptual")
package diagramConceptual;
@gmf.diagram(foo="bar")
class Schema {
val Entity[*] entity_schema;
val Attribute[*] attribute_schema;
val Relationship[*] relationship_schema;
val AttributeLink[*] attributeLink_schema;
val RelationshipLink[*] relationshipLink_schema;
}
@gmf.node(label="name", label.icon="false", figure="rectangle", size="100,50")
class Entity {
attr String name;
}
@gmf.node(label="name", label.icon="false", figure="ellipse", size="100,50")
class Attribute {
attr String name;
}
@gmf.node(label="name", label.icon="false", size="100,50")
class Relationship {
attr String name;
}
@gmf.link(source="source", target="target")
class AttributeLink {
ref Entity[1] source;
ref Attribute[1] target;
}
@gmf.link(source="source", target="target")
class RelationshipLink {
ref Entity[1] source;
ref Relationship[1] target;
}
Model 2 (Class Diagram):
@namespace(uri="diagramClass", prefix="diagramClass")
package diagramClass;
@gmf.diagram(foo="bar")
class Diagram {
val Table[*] table_diagram;
val RelationshipLink[*] relationshipLink_diagram;
}
@gmf.node(label="name", label.icon="false", figure="rectangle")
class Table {
attr String name;
@gmf.compartment(layout="list", collapsible="false")
val Attribute[*] attributes;
}
@gmf.node(label="name,type", figure="rectangle", label.icon="false", label.pattern="{0}:{1}")
class Attribute {
attr String name;
attr String type;
}
@gmf.link(source="source", target="target")
class RelationshipLink {
ref Table[1] source;
ref Table[1] target;
}
How to create a project "DatabaseProject" and after run it and working with two instances "Conceptual Diagram" and "Class Diagram" at the same time?
Thanks very much in advance for your answers!
Elvis
|
|
|
|
Re: Using two models in a single project [message #719712 is a reply to message #719540] |
Sun, 28 August 2011 11:09  |
Eclipse User |
|
|
|
Hi Antonio,
Thanks for the help. After watching the Screencasts (Establishing links between EMF models) I was in doubt of what would be the best way to work with two models, because plan to use EGL to generate a model through the other. Anyway I will follow your guidelines and use two separate plugins.
Thank you very much
Elvis
|
|
|
Powered by
FUDForum. Page generated in 0.03617 seconds