Re: FAMIX and Java Generics

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

Re: FAMIX and Java Generics

Tudor Girba
Hi Nicolas,

On 30 Mar 2011, at 23:44, Nicolas Anquetil wrote:

> Speaking of that, I have a doubt:
>
> If I have a declaration: Map<String,Object> anAttribute;
>
> I will create a ParameterizedType (named Map) with TypeParameters String and Object; and pointing to its ParameterizableClass Map (this time the generic definition).
>
> What should be the container of the ParameterizedType?

This is a very good question.

> At first, I thought I would define it as an internal type of the class owning 'anAttribute' because the parameterizedType is actually created at this very moment.

Yes, I prefer this solution.

> But then it could also be owned by 'java.lang' the package that owns the ParameterizableClass Map.
>
> Having 'anAttribute' appearing in moose with:
>
>   "DeclaredType: some::package::A_Class::Map<java::lang::String,java::lang::Object>"
>
> can be confusing. And it would get even worst if we were considering a method's parameter, whereas:
>
>   "DeclaredType: java::util::Map<java::lang::String,java::lang::Object>"
>
> seems to be more intuitive.
> But on the other hand, we loose some information in the second case.

This is printing problem and can be solved at that level. ParameterizedType also has a parameterizableClass property, and this can be used for pretty printing.

Cheers,
Doru



> nicolas
>
> ----- Mail original -----
>> De: "Tudor Girba" <[hidden email]>
>> À: "Moose-related development" <[hidden email]>
>> Envoyé: Mercredi 30 Mars 2011 19:59:55
>> Objet: [Moose-dev] Re: FAMIX and Java Generics
>> Hi Diego,
>>
>> This part is under works.
>>
>> First, FAMIX now supports Java Generics with ParameterizedType and
>> ParameterizableClass. Second, both inFusion and VerveineJ will
>> populate this information in the actual models.
>>
>> Cheers,
>> Doru
>>
>>
>> On 30 Mar 2011, at 16:43, Diego Fernandez wrote:
>>
>>> Hi all, using inFusion to get an MSE model from Java, I saw that the
>>> tool generates a FAMIX.Class for generic types used in parameters,
>>> for example:
>>>
>>> public interface AnInterface<T> {
>>>      void doSomething(T param);
>>> }
>>>
>>> Will generate a FAMIX.Class for T, and a reference to that class for
>>> the declaredType of "param".
>>>
>>> Is this the way to describe generic parameters in an MSE file or is
>>> a bug?
>>>
>>> Thanks,
>>> Diego
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> www.tudorgirba.com
>>
>> "Value is always contextual."
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Every thing should have the right to be different."




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

Re: FAMIX and Java Generics

Diego Fernández
Doru thanks for the info.

Where I can find information about the FAMIX representation of each code entity (in docs or in smalltalk code)?

On Thu, Mar 31, 2011 at 4:09 AM, Tudor Girba <[hidden email]> wrote:
Hi Nicolas,

On 30 Mar 2011, at 23:44, Nicolas Anquetil wrote:

> Speaking of that, I have a doubt:
>
> If I have a declaration: Map<String,Object> anAttribute;
>
> I will create a ParameterizedType (named Map) with TypeParameters String and Object; and pointing to its ParameterizableClass Map (this time the generic definition).
>
> What should be the container of the ParameterizedType?

This is a very good question.

> At first, I thought I would define it as an internal type of the class owning 'anAttribute' because the parameterizedType is actually created at this very moment.

Yes, I prefer this solution.

> But then it could also be owned by 'java.lang' the package that owns the ParameterizableClass Map.
>
> Having 'anAttribute' appearing in moose with:
>
>   "DeclaredType: some::package::A_Class::Map<java::lang::String,java::lang::Object>"
>
> can be confusing. And it would get even worst if we were considering a method's parameter, whereas:
>
>   "DeclaredType: java::util::Map<java::lang::String,java::lang::Object>"
>
> seems to be more intuitive.
> But on the other hand, we loose some information in the second case.

This is printing problem and can be solved at that level. ParameterizedType also has a parameterizableClass property, and this can be used for pretty printing.

Cheers,
Doru



> nicolas
>
> ----- Mail original -----
>> De: "Tudor Girba" <[hidden email]>
>> À: "Moose-related development" <[hidden email]>
>> Envoyé: Mercredi 30 Mars 2011 19:59:55
>> Objet: [Moose-dev] Re: FAMIX and Java Generics
>> Hi Diego,
>>
>> This part is under works.
>>
>> First, FAMIX now supports Java Generics with ParameterizedType and
>> ParameterizableClass. Second, both inFusion and VerveineJ will
>> populate this information in the actual models.
>>
>> Cheers,
>> Doru
>>
>>
>> On 30 Mar 2011, at 16:43, Diego Fernandez wrote:
>>
>>> Hi all, using inFusion to get an MSE model from Java, I saw that the
>>> tool generates a FAMIX.Class for generic types used in parameters,
>>> for example:
>>>
>>> public interface AnInterface<T> {
>>>      void doSomething(T param);
>>> }
>>>
>>> Will generate a FAMIX.Class for T, and a reference to that class for
>>> the declaredType of "param".
>>>
>>> Is this the way to describe generic parameters in an MSE file or is
>>> a bug?
>>>
>>> Thanks,
>>> Diego
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> www.tudorgirba.com
>>
>> "Value is always contextual."
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Every thing should have the right to be different."




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


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