[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.emf] containment co-existing with references for a property?
|
- From: Nikolaj Berntsen <nberntsen@xxxxxxxxxxxx>
- Date: Fri, 29 Aug 2003 13:32:41 +0200
- Newsgroups: eclipse.tools.emf
- Organization: EclipseCorner
- User-agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.4) Gecko/20030624
Hi,
Is it possible to have a class, B, have a property 'prop' of type C,
that is either contained or referenced (contained in another class A)?
Phrased differently: Is it necessary to have one property for references
and another for containment?
For example:
Class A can contain class B and C. Class B can contain class C. Can
class B also have the possibility of referencing an instance of Class C
contained in class A and contain another instance of Class C.
In some kind of pseudo XML notation:
<A>
<B prop="//@A//@C.1">
<C/>
</B>
<C/>
</A>
Written in java interfaces it would be something like the following code
- with the unclear points marked XXX and YYY:
/** @model */
interface A {
/** @model containment="true" */
B getFoo();
/** @model containment="true" XXX */
C getSee()
}
/** @model */
interface B {
/** @model containment=true YYY */
C getProp();
}
Perhaps it is something to do with opposite="..."? or using both
container="..." and contaiment="..."?
I must admit I haven't experimented much with it, but reading the
documentation does not make the answer clear to me.
I think it would be a nice thing to be able to do. Imagine class C
being, say, Image, and class B being Screen. Then some images would be
used on different Screens and some would only belong to a single screen.
It would be nice to be able to see that from the tree structure. Class A
could then be the container of screens.
Thanks in advance,
/\/ikolaj