Hi Nicolas, 

1) the asMooseGroup is just a standard moose method used to convert a collection into a MooseGroup object. 
I will probably move it in the lift:from: method. 
No filtering option is currently supported. 
What you get right now are objects of type FAMIXLiftedAssociation representing inferred associations. 
These objects have a reference to the source and target high level entities they connect and to the low level concrete associations which they abstract.
One possible extension (as you suggested) could be adding the following method: 

lift: aSelector from: aMooseGroup  filter: aBlock 

and some shortcuts like: 

lift: aSelector from: aMooseGroup  sourceEntities   -->  aBlock := [:each | each from]
lift: aSelector from: aMooseGroup  targetEntities   -->  aBlock := [:each | each to]

2) is point one answering your question ?  

3) I'm not sure i understand your question. 
Scoping is implicitly defined by the entities contained in the MooseGroup on which the query is executed and the MooseGroup specified in the from parameter. 
This means that if you execute: 

highLevelGroup := MooseModel root first allNamespaces.
lowLevelGroup := MooseModel root first allMethods.
(highLevelGroup lift: #incomingInvocations from:lowLevelGroup) asMooseGroup.

you will get a set of associations connecting namespaces (high level scope) and these associations will abstract concrete association existing between entities of type method (low level scope).

I hope i answered your question. 
Let me know what you think about. 

cheers,
Andrea
 

On Jun 19, 2012, at 2:44 PM, Nicolas Anquetil wrote:

Hi Andrea,
(and doru incidently)

The "more generic" part of your goal was not explicited in the previous email, so the mention of moosechef and the examples, led me on a wrong path.

you can safely ignore my previous comment :-)

Now, keeping an analogy with MooseChef, it implements thing that you might want to consider (at this level of abstraction it's a bit hard to tell):

- relation vs. entities
  can you filter the results to return either the relationships or the entities they relate?
  Is that what 'asMooseGroup' is doing? If so you might want to consider some other name (eg 'asEntities')

- relation roles
  MooseChef allows to request either the 'to' or 'from' end of an association, can you similarly specify the 'selector1' or 'selector2' (or 'selector3', ...) roles of your generic relationship?

- scoping
  Can you restrict the resulting entities/relationship to be of a given type?

as we are at a very abstract level, it might be better to offer a filterBlock and let the user define what kind of filter he whishes to apply?

nicolas

PS: I had a glance at your code. The mehtods look suspiciously long for a smalltalk implementation ...


De: "Andrea Caracciolo" <andyy.mailbox@gmail.com>
À: "Moose-related development" <moose-dev@iam.unibe.ch>
Envoyé: Mardi 19 Juin 2012 11:44:52
Objet: [Moose-dev] Re: Lift

Hi Nicolas, 

You are right, the syntax of moose chef is more elegant. 
But the point of creating a new extension was to offer the option to express more generic queries. 

If you are working on a moose model which represents a Java program, you can easily use moose chef and get what you need. 
But if the model you are analyzing is of a different kind (a famix extension or a generic moose model) and provides unforseen selectors and entities, what can you do ? 

You have to look at Lift as a less domain-bound version of chef, not necessarily as a chef replacement. 

Did i understand your question correctly ? 
Does it make sense to you ? 

Andrea

On Jun 19, 2012, at 11:06 AM, Nicolas Anquetil wrote:

Hk Andrea,

I had a quick look at Lift.
Being able to express the queries on MooseGroups is a nice addon.

But I think it would have been much nicer keeping the syntax of MooseChef.

Instead of:

(aNamespaceGroup lift: #incomingInvocations from:self mooseModel allMethods) asMooseGroup

why don't you use:

aNamespaceGroup queryIncomingInvocations atNamespaceScope

which according to MooseChef syntax should return the same thing ?

I trust you will agree the second is more elegant , and it has the advantage of keeping the same syntax, so we don't need to learn a new syntax

nicolas

On 18/06/12 14:39, Andrea Caracciolo wrote:
Hi, 

I developed a small extension which allows to query a moose model to obtain a set of implicit associations derived from low level relationships. 
What you can do concretely is for example to select a group of namespace entities, and ask for all implicit associations existing between the selected entities based on a specific relationship existing at a lower abstraction level (i.e.: the method level). 
The end result is much similar to the one provided by Moose Chef, with the advantage of being much more generic and flexible. 
Each generated association keeps a reference to the concrete relationships on which it is based on. 

If you are interested, you can try it out at: http://www.squeaksource.com/Lift.html
The wiki page contains some usage examples. 

cheers,
Andrea

_____________________________
Andrea Caracciolo -- caracciolo@iam.unibe.ch
Software Composition Group
University of Bern


_______________________________________________
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


_______________________________________________
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