Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » interdependent attributes b/w classes(How to show the Attributes dependencies)
interdependent attributes b/w classes [message #556685] Thu, 02 September 2010 10:41 Go to next message
Santhosh Injineri is currently offline Santhosh InjineriFriend
Messages: 4
Registered: August 2010
Junior Member
Hello Friends,

I am new to EMF and I am using Ecore model to generate the code ... Mz requirement is i have 2 classes classA and classB.

Attributes in ClassA is -> nameA:EString , typeA:EString
Attribute in ClassB is -> nameB:EString , typeB:nameA

I want Attribute typeB in ClassB should depend on value held by Attr nameA.

For Example1:

nameA=Pressure , typeA:Int

nameB=HighPressure, typeB=Pressure

Example2:

nameA=Switch, typeA:ON,OFF

nameB=TwoWaySwitch, typeB=Switch
Re: interdependent attributes b/w classes [message #556752 is a reply to message #556685] Thu, 02 September 2010 14:05 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Santhosh,

You should model the relationships (the references from ClassA to Class
B and vice versa) from which the information is derived. Modeling the
derived attribute itself is mostly a convenience and will require you to
write the derivation code...


Santhosh Injineri wrote:
> Hello Friends,
>
> I am new to EMF and I am using Ecore model to generate the code ... Mz
> requirement is i have 2 classes classA and classB.
>
> Attributes in ClassA is -> nameA:EString , typeA:EString
> Attribute in ClassB is -> nameB:EString , typeB:nameA
>
> I want Attribute typeB in ClassB should depend on value held by Attr
> nameA.
>
> For Example1:
>
> nameA=Pressure , typeA:Int
>
> nameB=HighPressure, typeB=Pressure
>
> Example2:
>
> nameA=Switch, typeA:ON,OFF
>
> nameB=TwoWaySwitch, typeB=Switch


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] cdoPrefetch
Next Topic:[Announce] Modeling Classes - Sep. 20 - Nov. 5
Goto Forum:
  


Current Time: Thu Apr 25 02:18:27 GMT 2024

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

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

Back to the top