Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » model attributes for each pair of class A and class B
model attributes for each pair of class A and class B [message #641742] Sat, 27 November 2010 14:16 Go to next message
Carsten Schr is currently offline Carsten SchrFriend
Messages: 2
Registered: November 2010
Junior Member
Hi all,
I am not at all experienced with model driven development, so I hope I can make myself understood.

I have constructed a model which defines two classes A and B. In addition it defines a class that holds a reference to exactly one A and exactly one B with the purpose to set a number of attributes for these pairs.

The problem is that these attributes MUST be defined for EACH pair of object of class A or B, respectively. For example, if I have two objects a1,a2 of class A and three objects b1,b2,b3 of class B, I need six pair objects (a1,b1),(a1,b2),(a1,b3),(a2,b1),(a2,b1),(a2,b3).

Can I force by model design that all these six pairs must exist for the validation of a model?

Thank you
Carsten
Re: model attributes for each pair of class A and class B [message #641756 is a reply to message #641742] Sat, 27 November 2010 16:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Carsten,

Comments below.

Carsten Schr wrote:
> Hi all,
> I am not at all experienced with model driven development, so I hope I
> can make myself understood.
>
> I have constructed a model which defines two classes A and B. In
> addition it defines a class that holds a reference to exactly one A
> and exactly one B with the purpose to set a number of attributes for
> these pairs.
>
> The problem is that these attributes MUST be defined for EACH pair of
> object of class A or B, respectively. For example, if I have two
> objects a1,a2 of class A and three objects b1,b2,b3 of class B, I need
> six pair objects (a1,b1),(a1,b2),(a1,b3),(a2,b1),(a2,b1),(a2,b3).
>
> Can I force by model design that all these six pairs must exist for
> the validation of a model?
Not really. if you defined some type of container that held the A and B
as well as the links/pairs you could define a name constraint on that
and implement it to check that all the combinations appear.
>
> Thank you
> Carsten


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: model attributes for each pair of class A and class B [message #641761 is a reply to message #641756] Sat, 27 November 2010 17:33 Go to previous message
Carsten Schr is currently offline Carsten SchrFriend
Messages: 2
Registered: November 2010
Junior Member
Quote:
if you defined some type of container that held the A and B
as well as the links/pairs you could define a name constraint on that
and implement it to check that all the combinations appear.

Thank you. I'll implement it as you suggest.

Carsten
Previous Topic:Modeling Subclassing behaviour
Next Topic:create actions for each EOperation semi-automatically in editor plugin
Goto Forum:
  


Current Time: Fri Apr 19 23:11:01 GMT 2024

Powered by FUDForum. Page generated in 0.13266 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top