reflections upon MooseChef withoutSelfLoops and scoping

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

reflections upon MooseChef withoutSelfLoops and scoping

Nicolas Anquetil
Anybody can submit an opinion to the following issue:

MooseChef allows to express a query such as:

   aClass queryOutgoingInvocations
   aMethod queryOutgoingReferences

that will return all methods invoked from 'aClass' for the first query
and all classes referenced by 'aMethod' in the second query

Then you can constraint the scope of the result, for example to say that
you are interested by the package containing the referenced classes

   aMethod queryOutgoingReferences atPackageScope

You can also down scope the result, for example to say you want all the
methods of the class referenced:

   aMethod queryOutgoingReferences atMethodScope

Finally, there is something to say you are not interested in relation
that loop back to the original object queried

   aClass queryOutgoingInvocations withoutSelfLoops

will return all classes that own methods invoked from 'aClass' except
'aClass' itself (that would be a selfLoop)

one sees on this example that withoutSelfLoops involves some scoping:
queryOutgoingInvocations will return a collection of methods, but the
query was sent to a class.
So when we say withoutSelfLoop, we actually mean all methods that don't
belong to the class to which the query was sent.
This is equivalent to:

   aClass queryOutgoingInvocations atClassScope withoutSelfLoops

Up to now, the semantic is rather Ok, but when you use hidden down
scoping, it starts to be less clear:

   aMethod queryOutgoingReference withoutSelfLoops

will return all classes referenced in 'aMethod' taken at methodScope and
removing self loop.
In the end, the result will ignore references to the class owning 'aMethod'.

What do you think?
There is some logic in the semantic, but it is not so intuitive.
Looking at the query, I cannot convince me that this is the result that
one would expect.

Should we change the semantic?
To what? (keep up-scoping and forbid implicit down-scoping? forbid all
implicit re-scoping?)

nicolas

PS: This may look like a rather theoretical question, but I actually
have a bug partly related to that and I need to know how to solve it
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: reflections upon MooseChef withoutSelfLoops and scoping

Stéphane Ducasse

On Jul 26, 2012, at 3:53 PM, Nicolas Anquetil wrote:

> Anybody can submit an opinion to the following issue:
>
> MooseChef allows to express a query such as:
>
>  aClass queryOutgoingInvocations
>  aMethod queryOutgoingReferences
>
> that will return all methods invoked from 'aClass' for the first query and all classes referenced by 'aMethod' in the second query
>
> Then you can constraint the scope of the result, for example to say that you are interested by the package containing the referenced classes
>
>  aMethod queryOutgoingReferences atPackageScope
>
> You can also down scope the result, for example to say you want all the methods of the class referenced:
>
>  aMethod queryOutgoingReferences atMethodScope

For me atXXScope is not really clear because I do not read it as asClass or asPackages
To me scope represents intuitively the scope of a query and this is difficult/strange to see it as a result but why not.
I think that resultsAsPackages and resultsAsMethods are clearer.

>  aMethod queryOutgoingReferences atPackageScope

I have a method, get all the references, then I want to get what? all the packages?

> aMethod queryOutgoingReferences resultsAsPackages???
> aMethod queryOutgoingReferences resultsAsMethods???



>  aMethod queryOutgoingReferences atMethodScope


I have a method, get all the references, then I get what? all the methods that contain the references?





nicolas it would be great to paste that mail in a little document somewhere :)

>
> Finally, there is something to say you are not interested in relation that loop back to the original object queried
>
>  aClass queryOutgoingInvocations withoutSelfLoops
>
> will return all classes that own methods invoked from 'aClass' except 'aClass' itself (that would be a selfLoop)
>
> one sees on this example that withoutSelfLoops involves some scoping: queryOutgoingInvocations will return a collection of methods, but the query was sent to a class.
> So when we say withoutSelfLoop, we actually mean all methods that don't belong to the class to which the query was sent.
> This is equivalent to:
>
>  aClass queryOutgoingInvocations atClassScope withoutSelfLoops
>
> Up to now, the semantic is rather Ok, but when you use hidden down scoping, it starts to be less clear:
>
>  aMethod queryOutgoingReference withoutSelfLoops
>
> will return all classes referenced in 'aMethod' taken at methodScope and removing self loop.
> In the end, the result will ignore references to the class owning 'aMethod'.
>
> What do you think?
> There is some logic in the semantic, but it is not so intuitive.
> Looking at the query, I cannot convince me that this is the result that one would expect.

unclear to me.
Sorry

>
> Should we change the semantic?
> To what? (keep up-scoping and forbid implicit down-scoping? forbid all implicit re-scoping?)
>
> nicolas
>
> PS: This may look like a rather theoretical question, but I actually have a bug partly related to that and I need to know how to solve it
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: reflections upon MooseChef withoutSelfLoops and scoping

abergel
> For me atXXScope is not really clear because I do not read it as asClass or asPackages
> To me scope represents intuitively the scope of a query and this is difficult/strange to see it as a result but why not.
> I think that resultsAsPackages and resultsAsMethods are clearer.

maybe scopeToClasses, scopeToPackages?
At least there is a verb in the message, which is good (and important for me).

>> aMethod queryOutgoingReferences atPackageScope
>
> I have a method, get all the references, then I want to get what? all the packages?

My guess:
you get all the packages that reference aMethod

>> aMethod queryOutgoingReferences atMethodScope
> I have a method, get all the references, then I get what? all the methods that contain the references?

The methods that referenced by aMethod

Cheers,
Alexandre


>
>
>
>
>
> nicolas it would be great to paste that mail in a little document somewhere :)
>
>>
>> Finally, there is something to say you are not interested in relation that loop back to the original object queried
>>
>> aClass queryOutgoingInvocations withoutSelfLoops
>>
>> will return all classes that own methods invoked from 'aClass' except 'aClass' itself (that would be a selfLoop)
>>
>> one sees on this example that withoutSelfLoops involves some scoping: queryOutgoingInvocations will return a collection of methods, but the query was sent to a class.
>> So when we say withoutSelfLoop, we actually mean all methods that don't belong to the class to which the query was sent.
>> This is equivalent to:
>>
>> aClass queryOutgoingInvocations atClassScope withoutSelfLoops
>>
>> Up to now, the semantic is rather Ok, but when you use hidden down scoping, it starts to be less clear:
>>
>> aMethod queryOutgoingReference withoutSelfLoops
>>
>> will return all classes referenced in 'aMethod' taken at methodScope and removing self loop.
>> In the end, the result will ignore references to the class owning 'aMethod'.
>>
>> What do you think?
>> There is some logic in the semantic, but it is not so intuitive.
>> Looking at the query, I cannot convince me that this is the result that one would expect.
>
> unclear to me.
> Sorry
>>
>> Should we change the semantic?
>> To what? (keep up-scoping and forbid implicit down-scoping? forbid all implicit re-scoping?)
>>
>> nicolas
>>
>> PS: This may look like a rather theoretical question, but I actually have a bug partly related to that and I need to know how to solve it
>> _______________________________________________
>> 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

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



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