How to get outer data in model. [message #199591] |
Thu, 31 July 2008 17:13 |
Eclipse User |
|
|
|
Originally posted by: jiezi506.gmail.com
<module:>
<shareData/>
<shareData/>
<shareData/>
<a>
<b>
<c>
<d>
</d>
</c>
</b>
</a>
</module>
above is a tree model,now I want to make a sub-tree:<d></d>,but I need
some share data between the whole-tree and the sub-tree,
I think up two solutions,
The first solution is:
construct two diagram for whole-tree and sub-tree like below
<notation:Diagram xmi:id="" type="" >
<children>
<element href="default.model#//@module/@shareData.0"/>
</children>
<children>
<element href="default.model#//@module/@shareData.1"/>
</children>
<children>
<element href="default.model#//@module/@shareData.2"/>
</children>
<children>
<children>
<children>
<children>
<element href="default.model#//@module/@d"/>
</children>
<element href="default.model#//@module/@c"/>
</children>
<element href="default.model#//@module/@b"/>
</children>
<element href="default.model#//@module/@a"/>
</children>
<element href="default.model#//@module"/>
</notation:Diagram>
<notation:Diagram xmi:id="" type="" >
<children>
<element href="default.model#//@module/@shareData.1"/>
</children>
<children>
<element href="default.model#//@module/@shareData.2"/>
</children>
<element href="default.model#//@module/@a/@b/@c/@d"/>
</notation:Diagram>
but the second diagram can't access the data "shareData" of parent,
"<element href="default.model#//@module/@a/@b/@c/@d"/>" decides all the
model in sub-tree.
The second solution is:
I construct the second diagram like below,
<notation:Diagram xmi:id="" type="" >
<children>
<element href="default.model#//@module/@shareData.1"/>
</children>
<children>
<element href="default.model#//@module/@shareData.2"/>
</children>
<children>
<element href="default.model#//@module/@d"/>
</children>
<element href="default.model#//@module"/>
</notation:Diagram>
but I find when I make the diagram with differences with model,it's
meaningless.
"<element href="default.model#//@module"/>" decides what to display in
editor,there is a/b/c/d 4 layers yet,instead of just d 1 layer which I
want to get.
I can't control the display in editor just by diagram.
I'm sorry about my bad English,but I need some help however,thx.
|
|
|
Powered by
FUDForum. Page generated in 0.02764 seconds