On Tue, Apr 14, 2015 at 10:02 PM, Alexandre Bergel <alexandre.bergel@me.com> wrote:
Well spotted!

Nicolas drew my attention to it. I am just the messenger :)
 

Would it be possible to have this declaredType pointing to an association?
Would it be difficult to have?

That is another possibility but I prefer the solution I proposed because it is transparent for current tools using declared type. 



 

Cheers,
Alexandre


> Le 14 avr. 2015 à 06:41, Usman Bhatti <usman.bhatti@gmail.com> a écrit :
>
> Hi,
>
> Consider a piece of code:
>
> Class MyClass
> {
>    public String method A()
>    {
>         String a;
>    }
> }
>
> In the code above, there is a relationship between the method A and the return type String. As per my understanding, this relationship is represented with declaredType in FAMIXBehaviouralEntity.
>
> Currently, this relationship is represented as a simple link (see FAMIXType>>declaredType) between the two entities but not as a FAMIXAssociation. Hence, when iterating over all the links/associations between two entities, we have to specifically take into account this special case. Currently, MooseChef helps in computing this information but one should know that there are other links on top of associations:
>
> TDependencyQueries>>queryIncomingDependencies
>
>       "Associations + typeDeclaractions"
>       ^ self queryAllIncomingAssociations
>               addAll: self queryIncomingTypeDeclarations;
>               yourself
>
> Another and more uniform solution would be to modify declaredType by creating an additional reference. For example, a trivial solution can be:
>
> declaredType: aType
>       declaredType :=  FMMultivalueLink on: self
>                                       update: #behavioursWithDeclaredType
>                                       from: self declaredType
>                                       to: aType.
>       self mooseModel ifNotNil: [self mooseModel add: (FAMIXReference new source: self; target: self declaredType) ]
>
> This change will be transparent for the current tools.
>
> Please provide your feedback.
>
> Usman
> _______________________________________________
> Moose-dev mailing list
> Moose-dev@iam.unibe.ch
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev