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 10:06 Go to next message
Benjamin Bihler is currently offline Benjamin Bihler
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 11:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25948
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
Re: Modeling with existing super classes [message #550107 is a reply to message #549981] Thu, 29 July 2010 03:31 Go to previous messageGo to next message
Benjamin Bihler is currently offline Benjamin Bihler
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 10:10 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25948
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!
Re: Modeling with existing super classes [message #619926 is a reply to message #549981] Thu, 29 July 2010 03:31 Go to previous message
Benjamin Bihler is currently offline Benjamin Bihler
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 10:10 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25948
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!
Previous Topic:Modeling with existing super classes
Next Topic:Shoot me now and get it over with
Goto Forum:
  


Current Time: Fri Aug 01 03:56:45 EDT 2014

Powered by FUDForum. Page generated in 0.03430 seconds