connecting a smalltalk class and a FamixClass

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

connecting a smalltalk class and a FamixClass

Usman Bhatti
hello all,

I am trying to create a distribution map for a moose model representing Citezen. Now, for each class, I am trying to color it according to its authors information. The following script should work for me:

|model packages|
model := (MooseModel root allModels) first.
packages := model allPackages.
(DistributionMap onContainers: packages elements: (model allModelClasses) properties: [:cl | cl authors > 10] )
render
open.

However, the method "authors" that I am invoking on cl (a FamixClass) is not defined by FamixClass but it is described by ClassDescription. Is there anyway to connect a FamixClass to its corresponding Smalltalk class?
I am thinking of getting the name of the FamixClass and somehow ask pharo to give me its corresponding Smalltalk class?

Any ideas if that should work?

thanx in advance,
Usman

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

Re: connecting a smalltalk class and a FamixClass

Andre Hora
Hello Usman,

As a fast solution, if you are working with a Smalltalk model, you dont need to load the code in Moose. You can analyze the code directly. For example, the code below should work:

| packages|

packages := RPackage organizer packages select: [ :each | each name matches: 'EyeSee'].

(DistributionMap
    onContainers: packages
    elements: (packages flatCollect: #classes)
    properties: [ :cl | cl authors size > 10] )
    render open.

regards,

On Thu, Nov 3, 2011 at 5:49 PM, Usman Bhatti <[hidden email]> wrote:
hello all,

I am trying to create a distribution map for a moose model representing Citezen. Now, for each class, I am trying to color it according to its authors information. The following script should work for me:

|model packages|
model := (MooseModel root allModels) first.
packages := model allPackages.
(DistributionMap onContainers: packages elements: (model allModelClasses) properties: [:cl | cl authors > 10] )
render
open.

However, the method "authors" that I am invoking on cl (a FamixClass) is not defined by FamixClass but it is described by ClassDescription. Is there anyway to connect a FamixClass to its corresponding Smalltalk class?
I am thinking of getting the name of the FamixClass and somehow ask pharo to give me its corresponding Smalltalk class?

Any ideas if that should work?

thanx in advance,
Usman

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




--
Andre Hora


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

Re: connecting a smalltalk class and a FamixClass

Usman Bhatti
Ok. 
Thanx Andre.

On Thu, Nov 3, 2011 at 6:42 PM, Andre Hora <[hidden email]> wrote:
Hello Usman,

As a fast solution, if you are working with a Smalltalk model, you dont need to load the code in Moose. You can analyze the code directly. For example, the code below should work:

| packages|

packages := RPackage organizer packages select: [ :each | each name matches: 'EyeSee'].

(DistributionMap
    onContainers: packages
    elements: (packages flatCollect: #classes)
    properties: [ :cl | cl authors size > 10] )
    render open.

regards,

On Thu, Nov 3, 2011 at 5:49 PM, Usman Bhatti <[hidden email]> wrote:
hello all,

I am trying to create a distribution map for a moose model representing Citezen. Now, for each class, I am trying to color it according to its authors information. The following script should work for me:

|model packages|
model := (MooseModel root allModels) first.
packages := model allPackages.
(DistributionMap onContainers: packages elements: (model allModelClasses) properties: [:cl | cl authors > 10] )
render
open.

However, the method "authors" that I am invoking on cl (a FamixClass) is not defined by FamixClass but it is described by ClassDescription. Is there anyway to connect a FamixClass to its corresponding Smalltalk class?
I am thinking of getting the name of the FamixClass and somehow ask pharo to give me its corresponding Smalltalk class?

Any ideas if that should work?

thanx in advance,
Usman

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




--
Andre Hora


_______________________________________________
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: connecting a smalltalk class and a FamixClass

Stéphane Ducasse
In reply to this post by Usman Bhatti
Usman

what we should do is a post importer that will add as property the authors information into FAMIXClass
I think that this is good exercise
        - how to run custom post importers.
        - how to represent information in FAMIX.
       
I would define a Moose-SmalltalkAuthor package
        to add an post importer
       
 I would defined a
        FAMIX-Core-Author package (or add it directly in Core)
        that defines author on FAMIXMethod and store a bag on FAMIXClass for now (we could perform the computation I did a class level at the FAMIX level if we want).


Stef

On Nov 3, 2011, at 5:49 PM, Usman Bhatti wrote:

> hello all,
>
> I am trying to create a distribution map for a moose model representing Citezen. Now, for each class, I am trying to color it according to its authors information. The following script should work for me:
>
> |model packages|
> model := (MooseModel root allModels) first.
> packages := model allPackages.
> (DistributionMap onContainers: packages elements: (model allModelClasses) properties: [:cl | cl authors > 10] )
> render
> open.
>
> However, the method "authors" that I am invoking on cl (a FamixClass) is not defined by FamixClass but it is described by ClassDescription. Is there anyway to connect a FamixClass to its corresponding Smalltalk class?
> I am thinking of getting the name of the FamixClass and somehow ask pharo to give me its corresponding Smalltalk class?
>
> Any ideas if that should work?
>
> thanx in advance,
> Usman
> _______________________________________________
> 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: connecting a smalltalk class and a FamixClass

abergel
I agree with you Stef. We definitely need a class to model authors. Should it be a subclass of MooseEntity or FamixEntity by the way?

In the process, we could also remove DudeDeveloper, itself a subclass of MooseEntity

Cheers,
Alexandre

On 3 Nov 2011, at 19:15, Stéphane Ducasse wrote:

> Usman
>
> what we should do is a post importer that will add as property the authors information into FAMIXClass
> I think that this is good exercise
> - how to run custom post importers.
> - how to represent information in FAMIX.
>
> I would define a Moose-SmalltalkAuthor package
> to add an post importer
>
> I would defined a
> FAMIX-Core-Author package (or add it directly in Core)
> that defines author on FAMIXMethod and store a bag on FAMIXClass for now (we could perform the computation I did a class level at the FAMIX level if we want).
>
>
> Stef
>
> On Nov 3, 2011, at 5:49 PM, Usman Bhatti wrote:
>
>> hello all,
>>
>> I am trying to create a distribution map for a moose model representing Citezen. Now, for each class, I am trying to color it according to its authors information. The following script should work for me:
>>
>> |model packages|
>> model := (MooseModel root allModels) first.
>> packages := model allPackages.
>> (DistributionMap onContainers: packages elements: (model allModelClasses) properties: [:cl | cl authors > 10] )
>> render
>> open.
>>
>> However, the method "authors" that I am invoking on cl (a FamixClass) is not defined by FamixClass but it is described by ClassDescription. Is there anyway to connect a FamixClass to its corresponding Smalltalk class?
>> I am thinking of getting the name of the FamixClass and somehow ask pharo to give me its corresponding Smalltalk class?
>>
>> Any ideas if that should work?
>>
>> thanx in advance,
>> Usman
>> _______________________________________________
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: connecting a smalltalk class and a FamixClass

Stéphane Ducasse
For now I was more thinking about something quick and dirty.
At least we should have the api

We want to make demos about authors so we should get them.

Stef

On Nov 4, 2011, at 12:39 PM, Alexandre Bergel wrote:

> I agree with you Stef. We definitely need a class to model authors. Should it be a subclass of MooseEntity or FamixEntity by the way?
>
> In the process, we could also remove DudeDeveloper, itself a subclass of MooseEntity
>
> Cheers,
> Alexandre
>
> On 3 Nov 2011, at 19:15, Stéphane Ducasse wrote:
>
>> Usman
>>
>> what we should do is a post importer that will add as property the authors information into FAMIXClass
>> I think that this is good exercise
>> - how to run custom post importers.
>> - how to represent information in FAMIX.
>>
>> I would define a Moose-SmalltalkAuthor package
>> to add an post importer
>>
>> I would defined a
>> FAMIX-Core-Author package (or add it directly in Core)
>> that defines author on FAMIXMethod and store a bag on FAMIXClass for now (we could perform the computation I did a class level at the FAMIX level if we want).
>>
>>
>> Stef
>>
>> On Nov 3, 2011, at 5:49 PM, Usman Bhatti wrote:
>>
>>> hello all,
>>>
>>> I am trying to create a distribution map for a moose model representing Citezen. Now, for each class, I am trying to color it according to its authors information. The following script should work for me:
>>>
>>> |model packages|
>>> model := (MooseModel root allModels) first.
>>> packages := model allPackages.
>>> (DistributionMap onContainers: packages elements: (model allModelClasses) properties: [:cl | cl authors > 10] )
>>> render
>>> open.
>>>
>>> However, the method "authors" that I am invoking on cl (a FamixClass) is not defined by FamixClass but it is described by ClassDescription. Is there anyway to connect a FamixClass to its corresponding Smalltalk class?
>>> I am thinking of getting the name of the FamixClass and somehow ask pharo to give me its corresponding Smalltalk class?
>>>
>>> Any ideas if that should work?
>>>
>>> thanx in advance,
>>> Usman
>>> _______________________________________________
>>> 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


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

Re: connecting a smalltalk class and a FamixClass

abergel
Having a good modeling of the author is indeed important. Just some ideas that pop out:

MooseAuthor>>dateOfTheLastCommit
        >>dateOfTheFirstCommit
        >>definedMethods
        >>definedClasses
        >>license
        >>name
        >>institution
        >>age
        >>fixedBugs
        >>openBugs

Naturally, not all of these info are available from the source code. But having the infrastructure is important and easy to get.

Alexandre


On 4 Nov 2011, at 09:04, Stéphane Ducasse wrote:

> For now I was more thinking about something quick and dirty.
> At least we should have the api
>
> We want to make demos about authors so we should get them.
>
> Stef
>
> On Nov 4, 2011, at 12:39 PM, Alexandre Bergel wrote:
>
>> I agree with you Stef. We definitely need a class to model authors. Should it be a subclass of MooseEntity or FamixEntity by the way?
>>
>> In the process, we could also remove DudeDeveloper, itself a subclass of MooseEntity
>>
>> Cheers,
>> Alexandre
>>
>> On 3 Nov 2011, at 19:15, Stéphane Ducasse wrote:
>>
>>> Usman
>>>
>>> what we should do is a post importer that will add as property the authors information into FAMIXClass
>>> I think that this is good exercise
>>> - how to run custom post importers.
>>> - how to represent information in FAMIX.
>>>
>>> I would define a Moose-SmalltalkAuthor package
>>> to add an post importer
>>>
>>> I would defined a
>>> FAMIX-Core-Author package (or add it directly in Core)
>>> that defines author on FAMIXMethod and store a bag on FAMIXClass for now (we could perform the computation I did a class level at the FAMIX level if we want).
>>>
>>>
>>> Stef
>>>
>>> On Nov 3, 2011, at 5:49 PM, Usman Bhatti wrote:
>>>
>>>> hello all,
>>>>
>>>> I am trying to create a distribution map for a moose model representing Citezen. Now, for each class, I am trying to color it according to its authors information. The following script should work for me:
>>>>
>>>> |model packages|
>>>> model := (MooseModel root allModels) first.
>>>> packages := model allPackages.
>>>> (DistributionMap onContainers: packages elements: (model allModelClasses) properties: [:cl | cl authors > 10] )
>>>> render
>>>> open.
>>>>
>>>> However, the method "authors" that I am invoking on cl (a FamixClass) is not defined by FamixClass but it is described by ClassDescription. Is there anyway to connect a FamixClass to its corresponding Smalltalk class?
>>>> I am thinking of getting the name of the FamixClass and somehow ask pharo to give me its corresponding Smalltalk class?
>>>>
>>>> Any ideas if that should work?
>>>>
>>>> thanx in advance,
>>>> Usman
>>>> _______________________________________________
>>>> 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
>
>
> _______________________________________________
> 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