Hi.

On Mon, Jul 11, 2016 at 12:00 AM, Meinert Schwartau <m.schwartau@gmail.com> wrote:
Hi,

I'm new to Moose and Pharo and have some problems to get started.

Welcome!
 
So how do you work with the moose panel?

For instance, I want to get all packages for all classes of the argouml showcase. I do this like this:

1. Select "All classes"

MoosePanel shows shows all the entities/associations found in your model. So, if packages are there you should also see "All Packages" group. If you do not see the group in the list, your parser didn't identify them (create them in the model).
 
2. Look in the Meta-Panel which methods are available
3. Enter "self allPackages" in evaluator and execute "Do it and Go"
4. => The result shows 0

The same for allModelPackages. 

I wonder what's the difference between allPackages and allModelPackages and why both return a result of zero.

When parsing a program, a parser finds some symbols and their definitions in the code. However, the definitions for all the symbols might not be available. For example, your program call a method foo but we do not have the source code of foo. In that case, this method becomes a stub. All queries of type allModelEntityName return a list of non-stub entities. allPackages should return all the packages (stub/non-stub identified in the program). If they both return 0, I suspect there are no packages in the model.
 
I would expect to get of all the packages the classes are in.

Try doing something like this on model: self allModelClasses collect: #parentPackage. If the list is empty, the parser didn't create packages in the model since allModelPackages returns empty collection.
 

If I do the same for the methods:

1. Select "All classes"
2. Look in the Meta-Panel which methods are available
3. Enter "self allMethods" in evaluator and execute "Do it and Go"
4. => The result shows 23k methods
5. Now I wanted to look at meta panel which methods are available but I don't see any method related except averageNumberOfInvocations and so on. The reason seems to be that the result is of type FAMIXMethodGroup. How to get from the group to the model for the methods so that I can access the parameter list of the methods and so on?

FAMIXMethodGroup inherits from MooseAbstractGroup that contains an entity collection and provide methods to iterate over individual elements. I would send this message to the group to collect all parameters: self collect: #parameters 
 

So how do you know which methods you can call, do you use the meta panel as well?

Yes, + class hierarchy.
 
Why do some methods return an empty result (like allPackages) even though they seem to be valid and should return a result?

If there are no packages in the model, the result is valid.
 
How to get to the content of a group?

self entityStorage. But you rarely want to do it. Instead you iterate over the entities.
 
Is there a more efficient way to work with moose or is this the way you work with it? How do you investigate these problems if you get some unreasonable return result?

Mostly in MoosePanel + debugger to see entities and the connections of individual elements.

HTH.
Usman
 

Best regards
Meinert



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