Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » Modeling with existing super classes(Absolute beginner's question)
Modeling with existing super classes [message #549940] Wed, 28 July 2010 14:06 Go to next message
Benjamin Bihler is currently offline Benjamin BihlerFriend
Messages: 20
Registered: July 2009
Junior Member
Hi there,


I am currently trying to evaluate the possibilities and advantages of model driven software development (I am an absolute beginner with this topic). Therefore I tried to create a simple ecore model of some existing classes in a certain package of my application.

I realized that the model implementation classes are not easily interchangeable with the original classes. The problem is that the original classes represent threads or SWING gui elements and are therefore derived from classes in different libraries. But as far as I understood the implementations of my model classes have to be derived from some certain classes like "EObjectImpl".

Is this true? Is modeling only useful with basic classes derived from Object? Or how can I modify my model to create classes derived from classes that are not contained in my model?

Thank you very much for your answers.


Benjamin
Re: Modeling with existing super classes [message #549981 is a reply to message #549940] Wed, 28 July 2010 15:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Benjamin,

comments below.

Benjamin Bihler wrote:
> Hi there,
>
>
> I am currently trying to evaluate the possibilities and advantages of
> model driven software development (I am an absolute beginner with this
> topic). Therefore I tried to create a simple ecore model of some
> existing classes in a certain package of my application.
>
> I realized that the model implementation classes are not easily
> interchangeable with the original classes.
It's easy to model interfaces and then generate implementations for
them, but existing classes (as opposed to interfaces) won't be able to
(easily) act as EObjects...
> The problem is that the original classes represent threads or SWING
> gui elements and are therefore derived from classes in different
> libraries.
You can wrap such things as EDataTypes.
> But as far as I understood the implementations of my model classes
> have to be derived from some certain classes like "EObjectImpl".
Certainly if you want fine grained access to the structure within such
objects. EDataType are generally best for simple immutable values that
can be converted to or from a String representation.
>
> Is this true? Is modeling only useful with basic classes derived from
> Object?
Yes and no.
> Or how can I modify my model to create classes derived from classes
> that are not contained in my model?
As I mentioned, you can model interfaces and generate implementations,
but values of existing classes will need to be wrapped as data types.
>
> Thank you very much for your answers.
>
>
> Benjamin


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Modeling with existing super classes [message #550107 is a reply to message #549981] Thu, 29 July 2010 07:31 Go to previous messageGo to next message
Benjamin Bihler is currently offline Benjamin BihlerFriend
Messages: 20
Registered: July 2009
Junior Member
>> The problem is that the original classes represent threads or SWING
>> gui elements and are therefore derived from classes in different
>> libraries.
>You can wrap such things as EDataTypes.

But than I have to aggregate the classes, haven't I? I have to add the thread for example as EAttribute and write some delegation code. True?

Thanks!
Re: Modeling with existing super classes [message #550206 is a reply to message #550107] Thu, 29 July 2010 14:10 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Benjamin,

Comments below.


Benjamin Bihler wrote:
>>> The problem is that the original classes represent threads or SWING
>>> gui elements and are therefore derived from classes in different
>>> libraries.
>> You can wrap such things as EDataTypes.
>
> But than I have to aggregate the classes, haven't I?
Not sure what that means.
> I have to add the thread for example as EAttribute and write some
> delegation code. True?
Yes, though I'm not sure what the purpose of the delegation would be.
You could have an attribute for the thread and someone could call
getThread and then work directly with the thread. Of course I'm not
sure how it makes sense for a thread value to be persistent, so likely
such a thing needs to be transient...
>
> Thanks!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Modeling with existing super classes [message #619926 is a reply to message #549981] Thu, 29 July 2010 07:31 Go to previous message
Benjamin Bihler is currently offline Benjamin BihlerFriend
Messages: 20
Registered: July 2009
Junior Member
>> The problem is that the original classes represent threads or SWING
>> gui elements and are therefore derived from classes in different
>> libraries.
>You can wrap such things as EDataTypes.

But than I have to aggregate the classes, haven't I? I have to add the thread for example as EAttribute and write some delegation code. True?

Thanks!
Re: Modeling with existing super classes [message #619927 is a reply to message #550107] Thu, 29 July 2010 14:10 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Benjamin,

Comments below.


Benjamin Bihler wrote:
>>> The problem is that the original classes represent threads or SWING
>>> gui elements and are therefore derived from classes in different
>>> libraries.
>> You can wrap such things as EDataTypes.
>
> But than I have to aggregate the classes, haven't I?
Not sure what that means.
> I have to add the thread for example as EAttribute and write some
> delegation code. True?
Yes, though I'm not sure what the purpose of the delegation would be.
You could have an attribute for the thread and someone could call
getThread and then work directly with the thread. Of course I'm not
sure how it makes sense for a thread value to be persistent, so likely
such a thing needs to be transient...
>
> Thanks!


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Modeling with existing super classes
Next Topic:Shoot me now and get it over with
Goto Forum:
  


Current Time: Fri Sep 20 23:01:41 GMT 2024

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

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

Back to the top