Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF attributes overriding
EMF attributes overriding [message #418595] Mon, 21 April 2008 20:34 Go to next message
Enrico Randazzo is currently offline Enrico RandazzoFriend
Messages: 13
Registered: July 2009
Junior Member
Hello,
is it possible to override attributes of classes in an EMF model (ecore
file)?

Into my ecore I have a class A with the attribute "name" with lower bound
set to 0 and upper bound set to 1. Then I have a class B that inherits
from A but in B I need to set the lower bound of the attribute "name" to 1.
If I simply redefine the "name" attribute in B as a result I obtain two
different "name" attributes in B, the one inherited from A and the one
defined in B!!!

Maybe I need to change some properties of the "name" attribute in A or in
B?



Thanks to all
Enrico
Re: EMF attributes overriding [message #418600 is a reply to message #418595] Mon, 21 April 2008 20:51 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090109010707040805040207
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Enrico,

No, EMF doesn't support redefining or overriding features. You could
define an named constraint on B and then implement it to check that the
name is actually set.

http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.Validation.html


Enrico wrote:
> Hello,
> is it possible to override attributes of classes in an EMF model
> (ecore file)?
>
> Into my ecore I have a class A with the attribute "name" with lower
> bound set to 0 and upper bound set to 1. Then I have a class B that
> inherits from A but in B I need to set the lower bound of the
> attribute "name" to 1.
> If I simply redefine the "name" attribute in B as a result I obtain
> two different "name" attributes in B, the one inherited from A and the
> one defined in B!!!
>
> Maybe I need to change some properties of the "name" attribute in A or
> in B?
>
>
>
> Thanks to all
> Enrico
>


--------------090109010707040805040207
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Enrico,<br>
<br>
No, EMF doesn't support redefining or overriding features.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF attributes overriding [message #418603 is a reply to message #418600] Mon, 21 April 2008 21:21 Go to previous messageGo to next message
Enrico Randazzo is currently offline Enrico RandazzoFriend
Messages: 13
Registered: July 2009
Junior Member
Ok, understood!
Thank you for your hint on named constraints.



Ed Merks wrote:

> Enrico,

> No, EMF doesn't support redefining or overriding features. You could
> define an named constraint on B and then implement it to check that the
> name is actually set.

>
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.Validation.html


> Enrico wrote:
>> Hello,
>> is it possible to override attributes of classes in an EMF model
>> (ecore file)?
>>
>> Into my ecore I have a class A with the attribute "name" with lower
>> bound set to 0 and upper bound set to 1. Then I have a class B that
>> inherits from A but in B I need to set the lower bound of the
>> attribute "name" to 1.
>> If I simply redefine the "name" attribute in B as a result I obtain
>> two different "name" attributes in B, the one inherited from A and the
>> one defined in B!!!
>>
>> Maybe I need to change some properties of the "name" attribute in A or
>> in B?
>>
>>
>>
>> Thanks to all
>> Enrico
>>
Re: EMF attributes overriding [message #418607 is a reply to message #418600] Mon, 21 April 2008 22:13 Go to previous messageGo to next message
Al B is currently offline Al BFriend
Messages: 130
Registered: July 2009
Senior Member
Hey Ed,

> http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.Validation.html

Notice that the page does not longer has a reference in the Table of
Contents tree on the left frame.

On other hand, this page can be found in the tree and it displays the
breadcrumb at the top.

http://help.eclipse.org/help33/topic/org.eclipse.emf.validat ion.doc/references/overview/languages.html

Is there any reason for that? I am just curious.
Re: EMF attributes overriding [message #418608 is a reply to message #418607] Mon, 21 April 2008 22:22 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
AJ,

Maybe Nick will understand the question...


AJ wrote:
> Hey Ed,
>
>> http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.Validation.html
>>
>
> Notice that the page does not longer has a reference in the Table of
> Contents tree on the left frame.
>
> On other hand, this page can be found in the tree and it displays the
> breadcrumb at the top.
>
> http://help.eclipse.org/help33/topic/org.eclipse.emf.validat ion.doc/references/overview/languages.html
>
>
> Is there any reason for that? I am just curious.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:MarkerUtil problem
Next Topic:Problem with setting focus after Undo/Redo
Goto Forum:
  


Current Time: Fri Mar 29 13:25:12 GMT 2024

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

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

Back to the top