Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » could anybody tell me what is 'interface' class?
could anybody tell me what is 'interface' class? [message #489451] Sat, 03 October 2009 06:49 Go to next message
flyduckegg  is currently offline flyduckegg Friend
Messages: 9
Registered: September 2009
Junior Member
I'm using the ECORE to build my metamodel, but | see there's two options for the normal Class, that is 'is interface' and 'is abstract', I know the later, but don't understand the former, could anybody tell me what is that? and how can I use it? thanks a lot.
Re: could anybody tell me what is 'interface' class? [message #489453 is a reply to message #489451] Sat, 03 October 2009 08:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31900
Registered: July 2009
Senior Member
If you specify isInterface to be true, an AbcImpl class won't be
generated for it; so it has to be isAbstract true as well.


flyduckegg wrote:
> I'm using the ECORE to build my metamodel, but | see there's two
> options for the normal Class, that is 'is interface' and 'is
> abstract', I know the later, but don't understand the former, could
> anybody tell me what is that? and how can I use it? thanks a lot.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: could anybody tell me what is 'interface' class? [message #489463 is a reply to message #489453] Sat, 03 October 2009 13:07 Go to previous messageGo to next message
flyduckegg  is currently offline flyduckegg Friend
Messages: 9
Registered: September 2009
Junior Member
Thanks a lot, then what is the difference between the Class (call A) only with 'isAbstract' and this Class (call B) with both 'isInterface' and 'isAbstract'?

As I know, A also will not be generated (I mean, when I build a model, it's not possible to create an instance for this abstract class), right? correct me if any mistake, I'm a beginner with EMF

Ed Merks wrote on Sat, 03 October 2009 04:36
If you specify isInterface to be true, an AbcImpl class won't be
generated for it; so it has to be isAbstract true as well.


flyduckegg wrote:
> I'm using the ECORE to build my metamodel, but | see there's two
> options for the normal Class, that is 'is interface' and 'is
> abstract', I know the later, but don't understand the former, could
> anybody tell me what is that? and how can I use it? thanks a lot.

Re: could anybody tell me what is 'interface' class? [message #489483 is a reply to message #489463] Sat, 03 October 2009 19:29 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
The difference is, that you won't find any implementation class
(commonly in *.impl package) for the interface. The generator will
produce code for both abstract and concrete classes only.

Since now, i used 'isInterface' rather few, but i think there are some
scenarios, where this is helpful - otherwise, it would have been
cancelled from the framework!

I guess, that it has something to do with the multiple inheritance
solution of EMF. There might a situation, where the usage of interfaces
for the construction of an inheritance hierarchy is preferred, but
actually i'm not quite sure... a hint from the EMF guys would help at
this point, i think ...


flyduckegg schrieb:
> Thanks a lot, then what is the difference between the Class (call A)
> only with 'isAbstract' and this Class (call B) with both 'isInterface'
> and 'isAbstract'?
>
> As I know, A also will not be generated (I mean, when I build a model,
> it's not possible to create an instance for this abstract class), right?
> correct me if any mistake, I'm a beginner with EMF
>
> Ed Merks wrote on Sat, 03 October 2009 04:36
>> If you specify isInterface to be true, an AbcImpl class won't be
>> generated for it; so it has to be isAbstract true as well.
>>
>>
>> flyduckegg wrote:
>> > I'm using the ECORE to build my metamodel, but | see there's two >
>> options for the normal Class, that is 'is interface' and 'is >
>> abstract', I know the later, but don't understand the former, could >
>> anybody tell me what is that? and how can I use it? thanks a lot.
>
>
Re: could anybody tell me what is 'interface' class? [message #489503 is a reply to message #489483] Sun, 04 October 2009 07:44 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31900
Registered: July 2009
Senior Member
Timothy,

Technically EClass.isInterface and EStructuralFeature.isVolatile
probably should have been GenClass/GenFeature properties because they
don't affect dynamic models, only generated ones. One could imagine a
case where multiple inheritance is used, but a given interface is never
the primary inheritance (first eSuperType) used by any other class and
hence there'd be no direct use nor reuse of the generated Impl for it...


Timothy Marc wrote:
> The difference is, that you won't find any implementation class
> (commonly in *.impl package) for the interface. The generator will
> produce code for both abstract and concrete classes only.
>
> Since now, i used 'isInterface' rather few, but i think there are some
> scenarios, where this is helpful - otherwise, it would have been
> cancelled from the framework!
>
> I guess, that it has something to do with the multiple inheritance
> solution of EMF. There might a situation, where the usage of
> interfaces for the construction of an inheritance hierarchy is
> preferred, but actually i'm not quite sure... a hint from the EMF guys
> would help at this point, i think ...
>
>
> flyduckegg schrieb:
>> Thanks a lot, then what is the difference between the Class (call A)
>> only with 'isAbstract' and this Class (call B) with both
>> 'isInterface' and 'isAbstract'?
>>
>> As I know, A also will not be generated (I mean, when I build a
>> model, it's not possible to create an instance for this abstract
>> class), right? correct me if any mistake, I'm a beginner with EMF
>>
>> Ed Merks wrote on Sat, 03 October 2009 04:36
>>> If you specify isInterface to be true, an AbcImpl class won't be
>>> generated for it; so it has to be isAbstract true as well.
>>>
>>>
>>> flyduckegg wrote:
>>> > I'm using the ECORE to build my metamodel, but | see there's two >
>>> options for the normal Class, that is 'is interface' and 'is >
>>> abstract', I know the later, but don't understand the former, could
>>> > anybody tell me what is that? and how can I use it? thanks a lot.
>>
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: could anybody tell me what is 'interface' class? [message #489585 is a reply to message #489503] Mon, 05 October 2009 07:07 Go to previous messageGo to next message
flyduckegg  is currently offline flyduckegg Friend
Messages: 9
Registered: September 2009
Junior Member
thanks, Timothy and Ed.

what is the implementation class used for? is that important? I usually creat dynamic instance from the ecore model, what's the difference between this one and the generated one?

also, I don't understand
'---but a given interface is never the primary inheritance (first eSuperType)--- '
here I attached a ecore model, the 'EClass3' is not the first eSupertype? it doesn't interit from anyone else.

Victor


I can't see the pic that I've attached, don't know why


Ed Merks wrote on Sun, 04 October 2009 03:44
Timothy,

Technically EClass.isInterface and EStructuralFeature.isVolatile
probably should have been GenClass/GenFeature properties because they
don't affect dynamic models, only generated ones. One could imagine a
case where multiple inheritance is used, but a given interface is never
the primary inheritance (first eSuperType) used by any other class and
hence there'd be no direct use nor reuse of the generated Impl for it...


Timothy Marc wrote:
> The difference is, that you won't find any implementation class
> (commonly in *.impl package) for the interface. The generator will
> produce code for both abstract and concrete classes only.
>
> Since now, i used 'isInterface' rather few, but i think there are some
> scenarios, where this is helpful - otherwise, it would have been
> cancelled from the framework!
>
> I guess, that it has something to do with the multiple inheritance
> solution of EMF. There might a situation, where the usage of
> interfaces for the construction of an inheritance hierarchy is
> preferred, but actually i'm not quite sure... a hint from the EMF guys
> would help at this point, i think ...
>
>
> flyduckegg schrieb:
>> Thanks a lot, then what is the difference between the Class (call A)
>> only with 'isAbstract' and this Class (call B) with both
>> 'isInterface' and 'isAbstract'?
>>
>> As I know, A also will not be generated (I mean, when I build a
>> model, it's not possible to create an instance for this abstract
>> class), right? correct me if any mistake, I'm a beginner with EMF
>>
>> Ed Merks wrote on Sat, 03 October 2009 04:36
>>> If you specify isInterface to be true, an AbcImpl class won't be
>>> generated for it; so it has to be isAbstract true as well.
>>>
>>>
>>> flyduckegg wrote:
>>> > I'm using the ECORE to build my metamodel, but | see there's two >
>>> options for the normal Class, that is 'is interface' and 'is >
>>> abstract', I know the later, but don't understand the former, could
>>> > anybody tell me what is that? and how can I use it? thanks a lot.
>>
>>

[Updated on: Mon, 05 October 2009 07:10]

Report message to a moderator

Re: could anybody tell me what is 'interface' class? [message #489594 is a reply to message #489585] Mon, 05 October 2009 07:35 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31900
Registered: July 2009
Senior Member
Comments below.

flyduckegg wrote:
> thanks, Timothy and Ed.
>
> what is the implementation class used for?
For implementing the interface. :-P
> is that important?
Yes, kind of.
> I usually creat dynamic instance from the ecore model, what's the
> difference between this one and the generated one?
A generated one performs better and takes less space.
>
> also, I don't understand '---but a given interface is never the
> primary inheritance (first eSuperType)--- '
> here I attached a ecore model, the 'EClass3' is not the first
> eSupertype? it doesn't interit from anyone else.
Java interfaces support multiple interface inheritance but Java classes
only support single class inheritance, right? So you can at most extend
one class and generally EMF will use the implementation class of the
first eSuperType.

Try generating code and looking at that to help explore your questions...
>
> Ed Merks wrote on Sun, 04 October 2009 03:44
>> Timothy,
>>
>> Technically EClass.isInterface and EStructuralFeature.isVolatile
>> probably should have been GenClass/GenFeature properties because they
>> don't affect dynamic models, only generated ones. One could imagine
>> a case where multiple inheritance is used, but a given interface is
>> never the primary inheritance (first eSuperType) used by any other
>> class and hence there'd be no direct use nor reuse of the generated
>> Impl for it...
>>
>>
>> Timothy Marc wrote:
>> > The difference is, that you won't find any implementation class >
>> (commonly in *.impl package) for the interface. The generator will >
>> produce code for both abstract and concrete classes only.
>> >
>> > Since now, i used 'isInterface' rather few, but i think there are
>> some > scenarios, where this is helpful - otherwise, it would have
>> been > cancelled from the framework!
>> >
>> > I guess, that it has something to do with the multiple inheritance
>> > solution of EMF. There might a situation, where the usage of >
>> interfaces for the construction of an inheritance hierarchy is >
>> preferred, but actually i'm not quite sure... a hint from the EMF
>> guys > would help at this point, i think ...
>> >
>> >
>> > flyduckegg schrieb:
>> >> Thanks a lot, then what is the difference between the Class (call
>> A) >> only with 'isAbstract' and this Class (call B) with both >>
>> 'isInterface' and 'isAbstract'?
>> >>
>> >> As I know, A also will not be generated (I mean, when I build a >>
>> model, it's not possible to create an instance for this abstract >>
>> class), right? correct me if any mistake, I'm a beginner with EMF
>> >>
>> >> Ed Merks wrote on Sat, 03 October 2009 04:36
>> >>> If you specify isInterface to be true, an AbcImpl class won't be
>> >>> generated for it; so it has to be isAbstract true as well.
>> >>>
>> >>>
>> >>> flyduckegg wrote:
>> >>> > I'm using the ECORE to build my metamodel, but | see there's
>> two > >>> options for the normal Class, that is 'is interface' and
>> 'is > >>> abstract', I know the later, but don't understand the
>> former, could >>> > anybody tell me what is that? and how can I use
>> it? thanks a lot.
>> >>
>> >>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: could anybody tell me what is 'interface' class? [message #621415 is a reply to message #489453] Sat, 03 October 2009 13:07 Go to previous message
flyduckegg  is currently offline flyduckegg Friend
Messages: 9
Registered: September 2009
Junior Member
Thanks a lot, then what is the difference between the Class (call A) only with 'isAbstract' and this Class (call B) with both 'isInterface' and 'isAbstract'?

As I know, A also will not be generated (I mean, when I build a model, it's not possible to create an instance for this abstract class), right? correct me if any mistake, I'm a beginner with EMF

Ed Merks wrote on Sat, 03 October 2009 04:36
> If you specify isInterface to be true, an AbcImpl class won't be
> generated for it; so it has to be isAbstract true as well.
>
>
> flyduckegg wrote:
> > I'm using the ECORE to build my metamodel, but | see there's two
> > options for the normal Class, that is 'is interface' and 'is
> > abstract', I know the later, but don't understand the former, could
> > anybody tell me what is that? and how can I use it? thanks a lot.
Re: could anybody tell me what is 'interface' class? [message #621418 is a reply to message #621415] Sat, 03 October 2009 19:29 Go to previous message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
The difference is, that you won't find any implementation class
(commonly in *.impl package) for the interface. The generator will
produce code for both abstract and concrete classes only.

Since now, i used 'isInterface' rather few, but i think there are some
scenarios, where this is helpful - otherwise, it would have been
cancelled from the framework!

I guess, that it has something to do with the multiple inheritance
solution of EMF. There might a situation, where the usage of interfaces
for the construction of an inheritance hierarchy is preferred, but
actually i'm not quite sure... a hint from the EMF guys would help at
this point, i think ...


flyduckegg schrieb:
> Thanks a lot, then what is the difference between the Class (call A)
> only with 'isAbstract' and this Class (call B) with both 'isInterface'
> and 'isAbstract'?
>
> As I know, A also will not be generated (I mean, when I build a model,
> it's not possible to create an instance for this abstract class), right?
> correct me if any mistake, I'm a beginner with EMF
>
> Ed Merks wrote on Sat, 03 October 2009 04:36
>> If you specify isInterface to be true, an AbcImpl class won't be
>> generated for it; so it has to be isAbstract true as well.
>>
>>
>> flyduckegg wrote:
>> > I'm using the ECORE to build my metamodel, but | see there's two >
>> options for the normal Class, that is 'is interface' and 'is >
>> abstract', I know the later, but don't understand the former, could >
>> anybody tell me what is that? and how can I use it? thanks a lot.
>
>
Re: could anybody tell me what is 'interface' class? [message #621420 is a reply to message #489483] Sun, 04 October 2009 07:44 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31900
Registered: July 2009
Senior Member
Timothy,

Technically EClass.isInterface and EStructuralFeature.isVolatile
probably should have been GenClass/GenFeature properties because they
don't affect dynamic models, only generated ones. One could imagine a
case where multiple inheritance is used, but a given interface is never
the primary inheritance (first eSuperType) used by any other class and
hence there'd be no direct use nor reuse of the generated Impl for it...


Timothy Marc wrote:
> The difference is, that you won't find any implementation class
> (commonly in *.impl package) for the interface. The generator will
> produce code for both abstract and concrete classes only.
>
> Since now, i used 'isInterface' rather few, but i think there are some
> scenarios, where this is helpful - otherwise, it would have been
> cancelled from the framework!
>
> I guess, that it has something to do with the multiple inheritance
> solution of EMF. There might a situation, where the usage of
> interfaces for the construction of an inheritance hierarchy is
> preferred, but actually i'm not quite sure... a hint from the EMF guys
> would help at this point, i think ...
>
>
> flyduckegg schrieb:
>> Thanks a lot, then what is the difference between the Class (call A)
>> only with 'isAbstract' and this Class (call B) with both
>> 'isInterface' and 'isAbstract'?
>>
>> As I know, A also will not be generated (I mean, when I build a
>> model, it's not possible to create an instance for this abstract
>> class), right? correct me if any mistake, I'm a beginner with EMF
>>
>> Ed Merks wrote on Sat, 03 October 2009 04:36
>>> If you specify isInterface to be true, an AbcImpl class won't be
>>> generated for it; so it has to be isAbstract true as well.
>>>
>>>
>>> flyduckegg wrote:
>>> > I'm using the ECORE to build my metamodel, but | see there's two >
>>> options for the normal Class, that is 'is interface' and 'is >
>>> abstract', I know the later, but don't understand the former, could
>>> > anybody tell me what is that? and how can I use it? thanks a lot.
>>
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: could anybody tell me what is 'interface' class? [message #621427 is a reply to message #489503] Mon, 05 October 2009 07:07 Go to previous message
flyduckegg  is currently offline flyduckegg Friend
Messages: 9
Registered: September 2009
Junior Member
thanks, Timothy and Ed.

what is the implementation class used for? is that important? I usually creat dynamic instance from the ecore model, what's the difference between this one and the generated one?

also, I don't understand
'---but a given interface is never the primary inheritance (first eSuperType)--- '
here I attached a ecore model, the 'EClass3' is not the first eSupertype? it doesn't interit from anyone else.

Ed Merks wrote on Sun, 04 October 2009 03:44
> Timothy,
>
> Technically EClass.isInterface and EStructuralFeature.isVolatile
> probably should have been GenClass/GenFeature properties because they
> don't affect dynamic models, only generated ones. One could imagine a
> case where multiple inheritance is used, but a given interface is never
> the primary inheritance (first eSuperType) used by any other class and
> hence there'd be no direct use nor reuse of the generated Impl for it...
>
>
> Timothy Marc wrote:
> > The difference is, that you won't find any implementation class
> > (commonly in *.impl package) for the interface. The generator will
> > produce code for both abstract and concrete classes only.
> >
> > Since now, i used 'isInterface' rather few, but i think there are some
> > scenarios, where this is helpful - otherwise, it would have been
> > cancelled from the framework!
> >
> > I guess, that it has something to do with the multiple inheritance
> > solution of EMF. There might a situation, where the usage of
> > interfaces for the construction of an inheritance hierarchy is
> > preferred, but actually i'm not quite sure... a hint from the EMF guys
> > would help at this point, i think ...
> >
> >
> > flyduckegg schrieb:
> >> Thanks a lot, then what is the difference between the Class (call A)
> >> only with 'isAbstract' and this Class (call B) with both
> >> 'isInterface' and 'isAbstract'?
> >>
> >> As I know, A also will not be generated (I mean, when I build a
> >> model, it's not possible to create an instance for this abstract
> >> class), right? correct me if any mistake, I'm a beginner with EMF
> >>
> >> Ed Merks wrote on Sat, 03 October 2009 04:36
> >>> If you specify isInterface to be true, an AbcImpl class won't be
> >>> generated for it; so it has to be isAbstract true as well.
> >>>
> >>>
> >>> flyduckegg wrote:
> >>> > I'm using the ECORE to build my metamodel, but | see there's two >
> >>> options for the normal Class, that is 'is interface' and 'is >
> >>> abstract', I know the later, but don't understand the former, could
> >>> > anybody tell me what is that? and how can I use it? thanks a lot.
> >>
> >>
Re: could anybody tell me what is 'interface' class? [message #621428 is a reply to message #621427] Mon, 05 October 2009 07:35 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31900
Registered: July 2009
Senior Member
Comments below.

flyduckegg wrote:
> thanks, Timothy and Ed.
>
> what is the implementation class used for?
For implementing the interface. :-P
> is that important?
Yes, kind of.
> I usually creat dynamic instance from the ecore model, what's the
> difference between this one and the generated one?
A generated one performs better and takes less space.
>
> also, I don't understand '---but a given interface is never the
> primary inheritance (first eSuperType)--- '
> here I attached a ecore model, the 'EClass3' is not the first
> eSupertype? it doesn't interit from anyone else.
Java interfaces support multiple interface inheritance but Java classes
only support single class inheritance, right? So you can at most extend
one class and generally EMF will use the implementation class of the
first eSuperType.

Try generating code and looking at that to help explore your questions...
>
> Ed Merks wrote on Sun, 04 October 2009 03:44
>> Timothy,
>>
>> Technically EClass.isInterface and EStructuralFeature.isVolatile
>> probably should have been GenClass/GenFeature properties because they
>> don't affect dynamic models, only generated ones. One could imagine
>> a case where multiple inheritance is used, but a given interface is
>> never the primary inheritance (first eSuperType) used by any other
>> class and hence there'd be no direct use nor reuse of the generated
>> Impl for it...
>>
>>
>> Timothy Marc wrote:
>> > The difference is, that you won't find any implementation class >
>> (commonly in *.impl package) for the interface. The generator will >
>> produce code for both abstract and concrete classes only.
>> >
>> > Since now, i used 'isInterface' rather few, but i think there are
>> some > scenarios, where this is helpful - otherwise, it would have
>> been > cancelled from the framework!
>> >
>> > I guess, that it has something to do with the multiple inheritance
>> > solution of EMF. There might a situation, where the usage of >
>> interfaces for the construction of an inheritance hierarchy is >
>> preferred, but actually i'm not quite sure... a hint from the EMF
>> guys > would help at this point, i think ...
>> >
>> >
>> > flyduckegg schrieb:
>> >> Thanks a lot, then what is the difference between the Class (call
>> A) >> only with 'isAbstract' and this Class (call B) with both >>
>> 'isInterface' and 'isAbstract'?
>> >>
>> >> As I know, A also will not be generated (I mean, when I build a >>
>> model, it's not possible to create an instance for this abstract >>
>> class), right? correct me if any mistake, I'm a beginner with EMF
>> >>
>> >> Ed Merks wrote on Sat, 03 October 2009 04:36
>> >>> If you specify isInterface to be true, an AbcImpl class won't be
>> >>> generated for it; so it has to be isAbstract true as well.
>> >>>
>> >>>
>> >>> flyduckegg wrote:
>> >>> > I'm using the ECORE to build my metamodel, but | see there's
>> two > >>> options for the normal Class, that is 'is interface' and
>> 'is > >>> abstract', I know the later, but don't understand the
>> former, could >>> > anybody tell me what is that? and how can I use
>> it? thanks a lot.
>> >>
>> >>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Graphical Ecore Editor and support for plugin URIs
Next Topic:Problem using jet.compile ANT task
Goto Forum:
  


Current Time: Sat Jun 12 21:59:31 GMT 2021

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

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

Back to the top