Using Moose => Questions

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

Using Moose => Questions

Gabriela Arevalo (gmail)-2
Hi guys,

I started to play with Moose, because I need to analyze some code to detect some bad smells.

As I used Moose ** a long time ago ** I am bit confused (and also lost) with the way of using and manipulating the objects in the Moose panel.

Just an example to explain what I need is that:

1- I loaded a package of Pharo (let's say Collections-Sequenceable)
I can see all the information offered by the panel, but I would like to do is the following:

a) How can I access to the information of the model, for example, to manipulate the methods of the analyzed classes? In previous versions of Moose, we could do something like MooseManager currentModel, but I see that the design has changed drastically, and now I can not see how I can do it. I need specifically access to the info stored in the model.

b) I see that you are using pragmas to define how we calculate properties in each source code entity. For example in: 
FAMIXMethod
numberOfInvokedMethods
<MSEProperty: #numberOfInvokedMethods type: #Number>
<MSEComment: 'Return a number corresponding to the number of invoked methods'>
<derived>
^ self privateState propertyAt: #numberOfInvokedMethods ifAbsentPut: [self invokedMethods size]

I added a new property with the same structure, but when I analyzed again a previous application, my new property is not appearing in the list of properties for a method in Moose.
Should I call a special message, or make a class invoke another method to update the properties used to analyze the application?

I will appreciate a lot your help.

Cheers,

Gabi


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Using Moose => Questions

Tudor Girba-2
Hi,


On Mon, Mar 17, 2014 at 4:37 PM, Gabriela Arevalo (gmail) <[hidden email]> wrote:
Hi guys,

I started to play with Moose, because I need to analyze some code to detect some bad smells.

As I used Moose ** a long time ago ** I am bit confused (and also lost) with the way of using and manipulating the objects in the Moose panel.

Welcome back! :)
 
Just an example to explain what I need is that:

1- I loaded a package of Pharo (let's say Collections-Sequenceable)
I can see all the information offered by the panel, but I would like to do is the following:

a) How can I access to the information of the model, for example, to manipulate the methods of the analyzed classes? In previous versions of Moose, we could do something like MooseManager currentModel, but I see that the design has changed drastically, and now I can not see how I can do it. I need specifically access to the info stored in the model.

The corresponding to "MooseManager currentModel" is now "MooseModel root allModels first".

However, you should not need to use this. Instead, once you have your hands on a model in the Moose Panel, you should simply switch to the last tab (with the [|] icon), and there self is your model. For example, if you need all methods, you should:
- type "self allMethods"
- select all text
- press Cmd+o (or right click and open)

This should pop the list of all method to the right.
 
b) I see that you are using pragmas to define how we calculate properties in each source code entity. For example in: 
FAMIXMethod
numberOfInvokedMethods
<MSEProperty: #numberOfInvokedMethods type: #Number>
<MSEComment: 'Return a number corresponding to the number of invoked methods'>
<derived>
^ self privateState propertyAt: #numberOfInvokedMethods ifAbsentPut: [self invokedMethods size]

I added a new property with the same structure, but when I analyzed again a previous application, my new property is not appearing in the list of properties for a method in Moose.
Should I call a special message, or make a class invoke another method to update the properties used to analyze the application?

You probably need to reinitialize the meta descriptions. Programatically, you  can just do: "MooseModel resetMeta". Or you can spawn the Meta Browser (from WorldMenu/Moose/Moose MetaBrowser) and then click on the refresh icon from the top right.

Let us know how it works.

Cheers,
Doru


I will appreciate a lot your help.

Cheers,

Gabi


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




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Using Moose => Questions

Gabriela Arevalo (gmail)-2
Doru,
 
As I used Moose ** a long time ago ** I am bit confused (and also lost) with the way of using and manipulating the objects in the Moose panel.

Welcome back! :)

Thanks! Amazing how the concept of the implementation of Moose has changed :)
 
The corresponding to "MooseManager currentModel" is now "MooseModel root allModels first".

However, you should not need to use this. Instead, once you have your hands on a model in the Moose Panel, you should simply switch to the last tab (with the [|] icon), and there self is your model. For example, if you need all methods, you should:
- type "self allMethods"
- select all text
- press Cmd+o (or right click and open)

This should pop the list of all method to the right.

If you are working with Moose from a user-viewpoint, the way you suggest is good one to use Moose as a query-engine.
But if you want to use the data or even the properties to calculate something (or even to build a tool on top of Moose), I think the panel of [|] seems not to be useful.
How do the other tools do? How does, such as Roassal, take the data coming from Moose? 

Cheers,

Gabi

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Using Moose => Questions

abergel
> How do the other tools do? How does, such as Roassal, take the data coming from Moose?

Directly from the model.
Some visualization are defined either on the class MooseModel, or on the class FAMIXClassGroup.

Alexandre


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



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Using Moose => Questions

Tudor Girba-2
In reply to this post by Gabriela Arevalo (gmail)-2
Hi Gabi,



On Mon, Mar 17, 2014 at 9:29 PM, Gabriela Arevalo (gmail) <[hidden email]> wrote:
Doru,
 
As I used Moose ** a long time ago ** I am bit confused (and also lost) with the way of using and manipulating the objects in the Moose panel.

Welcome back! :)

Thanks! Amazing how the concept of the implementation of Moose has changed :)
 
The corresponding to "MooseManager currentModel" is now "MooseModel root allModels first".

However, you should not need to use this. Instead, once you have your hands on a model in the Moose Panel, you should simply switch to the last tab (with the [|] icon), and there self is your model. For example, if you need all methods, you should:
- type "self allMethods"
- select all text
- press Cmd+o (or right click and open)

This should pop the list of all method to the right.

If you are working with Moose from a user-viewpoint, the way you suggest is good one to use Moose as a query-engine.
But if you want to use the data or even the properties to calculate something (or even to build a tool on top of Moose), I think the panel of [|] seems not to be useful.
How do the other tools do? How does, such as Roassal, take the data coming from Moose? 

I think we are facing a misunderstanding.

The Moose Panel is like an inspector with some specific functionalities. Nothing more. Essentially, all real logic you see is part of the model objects. So, if you want to build your code, you just program against objects. That is all.

But, let's be concrete and work by example. What exactly would you like to achieve?

Cheers,
Doru
 
Cheers,

Gabi

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




--

"Every thing has its own flow"

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