how to model that Java stuff in FAMIX

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to model that Java stuff in FAMIX

stephane ducasse
Consider the following Java code:

class X {
  int y = getnum();
  static int getnum() { return 0; }
}

line 2 is a method invocation:
- receiver = this
- signature = getnum()
- sender = class X

But metamodel says that 'sender' is a BehaviouralEntity (i.e. a Method or a Function)

Therefore the code cannot be represented .... :-(
 
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: how to model that Java stuff in FAMIX

jfabry

We see this problem in AspectMaps as well. In this example it would be that aspects apply to calls made to getnum(). Right now this is not displayed for the call in line 2 because it happens outside of a method.

How about considering all initializers like this as if they were called from a method '#init()' and getting the java->mse converter add this fake method + all the invocations that happen in initalizations? The call to '#init()' could even be added to all constructors by the importer. This way we make explicit the implicit initializations that are going on.

On 14 Jun 2010, at 14:48, stephane ducasse wrote:

> Consider the following Java code:
>
> class X {
>  int y = getnum();
>  static int getnum() { return 0; }
> }
>
> line 2 is a method invocation:
> - receiver = this
> - signature = getnum()
> - sender = class X
>
> But metamodel says that 'sender' is a BehaviouralEntity (i.e. a Method or a Function)
>
> Therefore the code cannot be represented .... :-(
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
Johan Fabry  
[hidden email] - http://dcc.uchile.cl/~jfabry
PLEIAD Lab - Computer Science Department (DCC) - University of Chile




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: how to model that Java stuff in FAMIX

Tudor Girba
Hi,

The simplest way to model these initializations would be to see them  
as being part of (all) constructors.

Another way would be to have a subclass of BehaviouralEntity that is  
an AttributeInitializer and that would point to the attribute and that  
would hold the invocations to the desired methods.

Cheers,
Doru


On 14 Jun 2010, at 21:09, Johan Fabry wrote:

>
> We see this problem in AspectMaps as well. In this example it would  
> be that aspects apply to calls made to getnum(). Right now this is  
> not displayed for the call in line 2 because it happens outside of a  
> method.
>
> How about considering all initializers like this as if they were  
> called from a method '#init()' and getting the java->mse converter  
> add this fake method + all the invocations that happen in  
> initalizations? The call to '#init()' could even be added to all  
> constructors by the importer. This way we make explicit the implicit  
> initializations that are going on.
>
> On 14 Jun 2010, at 14:48, stephane ducasse wrote:
>
>> Consider the following Java code:
>>
>> class X {
>> int y = getnum();
>> static int getnum() { return 0; }
>> }
>>
>> line 2 is a method invocation:
>> - receiver = this
>> - signature = getnum()
>> - sender = class X
>>
>> But metamodel says that 'sender' is a BehaviouralEntity (i.e. a  
>> Method or a Function)
>>
>> Therefore the code cannot be represented .... :-(
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> Johan Fabry
> [hidden email] - http://dcc.uchile.cl/~jfabry
> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"What we can governs what we wish."



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev