|
Re: Some thoughts on EMF intrefaces [message #781175 is a reply to message #781050] |
Fri, 20 January 2012 08:27 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Martin,
Comments below.
On 20/01/2012 9:19 AM, Martin odloucký wrote:
> Hi everyone,
> I wouůd like to here your opinion on something I just realized when
> using EMF. When I redisigned and refactored and redesigned again my
> model in EMF towards greater abstraction I ended up with model built
> only of interfaces. Then I finally realized that I used interfaces
> only to ensure that I can extend more than one class in my subsequent
> models. Since EMF can work with multiple inheritance I actually do not
> need any interfaces for that purpose at all. So I changed all the
> classes to abstract since generating the implementation does not cost
> anything and does not hurt either. Is this the correct insight?
You still get a generated Impl class when you make it abstract. You can
set "interface" to true (which also requires abstract to be true) and
then there won't get even the Impl classes.
> The EMF now looks to me like all the classes in any EMF model are more
> like interfaces - they only capture relationships among the modeled
> objects, nothing more.
Yes, but when mapped to Java, they map to both and interface and an
implementation class (by default).
> Maybe this is also a reason for the model generator to always generate
> a set of java interfaces for ALL classes in the model, abstract or not.
Yes, to support multiple inheritance in general, you generally always
need an interface. It's also nice to hide all the implementation
details behind interfaces...
>
> I am growing fond of EMF, it looks very exciting and I'd like to
> educate myself as much as possible so that's way I am posting this
> experience of mine....
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02998 seconds