as explained by Vincent, opposites gives you the entities on the other
end of the association you queried
for outgoing invocationsm the opposite can only be the invoked methods.
so it does what you want
but we qny other associations it will fail to return methods
the idea of atXXScope is that it raises or lowers the result to the
So outgoingInvocation should normally give methods, but with
atPackageScope, it will return the packages containing the methods
Therefore your implementation does not work
and it can be actually tricky to make it work.
The problem being that from the result you have, the system must
"guess"whether the scope asked is obtained by going up the containement
tree, for example from method to their classes (belongsTo) to their
packages (belongsTo) , or down the treem for example one could asked all
the referenced classes and down to their methods.
This is what the new MooseQuery solves with the two scoping selectors
that Anne mentionned
On 22/09/2015 21:07, Alexandre Bergel wrote:
> It didn't work if your association "opposite" is something else than a
> Try on a method of your model where the result is not empty:
> self queryOutgoingAccesses atMethodScope
I have tried only on outgoing invocations. I wrote a test about it.
But yes, what I have done is probably not optimal.
> You will see that the result is not methods but attributes.
> If you query references, you will get classes instead of methods...
> I think you should use MooseQuery that is designed to resolve these issues:
> user: ''
> password: ''
Well… I think MooseQuery should be added to Moose and not loaded as a separate package.
What is the status of it?
I had a look at Famix-Core.MooseQueryEXPERIMENTAL and MooseQuery. Tests are green and it
So, what next?