|
|
|
|
Re: Dynamic EMF / Multiple Inheritance [message #491058 is a reply to message #491030] |
Tue, 13 October 2009 04:06 |
John T.E. Timm Messages: 161 Registered: July 2009 |
Senior Member |
|
|
Ed,
Thanks for the reply. I actually created a Class3 with multiple inheritance in UML where one generalization was marked as <<extend>> and the other became an interface when I imported this into EMF, I got:
interface Class1
interface Class2
interface Class3 extends Class1, Class2
class Class3Impl extends Class1Impl implements Class3 {
protected String attribute2;
public String getAttribute2() { ... }
public void setAttribute2(String newAttribute2() { ... }
}
and ended up with features from Class2 copied down into Class3 (e.g. attribute2).
I was trying to replicate this scenario with dynamic EMF so that Class3 actually extends Class1 but also implements Class2 features (hence why I was asking about putting attribute2 into Class3).
I'm basically trying to replicate what is presented here:
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .emf.doc/references/overview/EMF.html
Where classes Book and Asset are statically defined and SchoolBook is created via dynamic EMF.
Thanks,
JT
[Updated on: Tue, 13 October 2009 04:15] Report message to a moderator
|
|
|
Re: Dynamic EMF / Multiple Inheritance [message #491059 is a reply to message #491058] |
Tue, 13 October 2009 04:14 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------050806040505020906030106
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
John,
Comments below.
John T.E. Timm wrote:
> Ed,
>
> Thanks for the reply. I actually created a Class3 with multiple
> inheritance in UML where one generalization was marked as <<extend>>
> and the other became an interface when I imported this into EMF, I got:
>
> interface Class1
> interface Class2
> interface Class3 extends Class1, Class2
>
> class Class3Impl extends Class1Impl implements Class1, Class2 {
Probably more like class Class3Impl extends Class1Impl implements
*Class3*, Class2 {
> protected String attribute2;
>
> public String getAttribute2() { ... }
> public void setAttribute2(String newAttribute2() { ...}
> }
>
> and ended up with features from Class2 copied down into Class3 (e.g.
> attribute2
The generated code for the mix-in class is duplicated, but that's not
the same as copying features in the Ecore model itself.
>
> I was trying to replicate this scenario with dynamic EMF so that
> Class3 actually extends Class1 but also implements Class2 features
> (hence why I was asking about putting attribute2 into Class3).
Ecore itself has no concept of extends verses implements. That's just
something in the generated Java code which isn't relevant when there
isn't any generated Java code.
>
> Thanks,
>
> JT
--------------050806040505020906030106
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
John,<br>
<br>
Comments below.<br>
<br>
John T.E. Timm wrote:
<blockquote cite="mid:hb0ubi$rfi$1@build.eclipse.org" type="cite">Ed,
<br>
<br>
Thanks for the reply. I actually created a Class3 with multiple
inheritance in UML where one generalization was marked as
<<extend>> and the other became an interface when I
imported this into EMF, I got:
<br>
<br>
interface Class1
<br>
interface Class2
<br>
interface Class3 extends Class1, Class2
<br>
<br>
class Class3Impl extends Class1Impl implements Class1, Class2 {
<br>
</blockquote>
Probably more like class Class3Impl extends Class1Impl implements <b>Class3</b>,
Class2 {
<blockquote cite="mid:hb0ubi$rfi$1@build.eclipse.org" type="cite">
protected String attribute2;
<br>
<br>
public String getAttribute2() { ... }
<br>
public void setAttribute2(String newAttribute2() { ...}
<br>
}
<br>
<br>
and ended up with features from Class2 copied down into Class3 (e.g.
attribute2
<br>
</blockquote>
The generated code for the mix-in class is duplicated, but that's not
the same as copying features in the Ecore model itself.<br>
<blockquote cite="mid:hb0ubi$rfi$1@build.eclipse.org" type="cite"><br>
I was trying to replicate this scenario with dynamic EMF so that Class3
actually extends Class1 but also implements Class2 features (hence why
I was asking about putting attribute2 into Class3).
<br>
</blockquote>
Ecore itself has no concept of extends verses implements. That's just
something in the generated Java code which isn't relevant when there
isn't any generated Java code.<br>
<blockquote cite="mid:hb0ubi$rfi$1@build.eclipse.org" type="cite"><br>
Thanks,
<br>
<br>
JT
<br>
</blockquote>
</body>
</html>
--------------050806040505020906030106--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.04706 seconds