How to view hierarchy of multiple classes in a package?

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

Re: How to view hierarchy of multiple classes in a package?

Tim Mackinnon
I finally got a chance to try this change out - and this a super helpful change - thanks so much. (It also taught me where some of the things live in Pharo).

Why wouldn’t this change be made permanent in the live Pharo? I can’t see any downside and it really helps understand new code.

Tim

On 30 Dec 2016, at 10:49, Henrik Nergaard <[hidden email]> wrote:

Changing ClassWidget>>#showHierarchy to:
showHierarchy: aBoolean
 
              | all |
              
              (showHierarchy := aBoolean) ifFalse:  [ ^ self ].
              
              all := IdentitySet new.
              model selectedPackageGroup asNautilusSelection classes do: [ :cls  |
                             all 
                                           addAll: cls allSuperclasses;
                                           addAll: cls withAllSubclasses
              ].
                                                                       
              self cachedHierarchy: (SortHierarchically buildHierarchyForClasses: all)
 
Will make the hierarchy button show the tree for all classes in that package/tag.
<image001.png>
 
Best regards,
Henrik
 
From: Pharo-users [[hidden email]] On Behalf Of Tim Mackinnon
Sent: Wednesday, December 28, 2016 5:24 PM
To: Any question about pharo is welcome <[hidden email]>
Subject: Re: [Pharo-users] How to view hierarchy of multiple classes in a package?
 
This seems to have generated a bit of conversation which has helped me quite a bit.
 
Denis, your picture has made me realise that the System browser is a bit better than I realised.
 
However the example I was looking at was a package that had a series of Announcement subclasses, AND what wasn't obvious was that they were all subclasses of the same parent "Announcement", as that isn't shown - you just get a series of classes not rooted under some parent (even if it was object). I'm guessing that just things that are subclasses of each other in the same package are shown?
 
I was hoping that pane might show -
 
Announcement
+ A
+ B
   + C
 
I'm now wondering what it will show if you had a few different subclasses of the different collection classes (ok it's a bad idea to subclass them, but my point is if you had a few models at different points in a hierarchy)?
 
I'm guessing you would see the same flat list - but I will go and try that to help me learn a bit more.
 
Tim

Reply | Threaded
Open this post in threaded view
|

Re: How to view hierarchy of multiple classes in a package?

Denis Kudriashov

2017-01-05 12:11 GMT+01:00 Tim Mackinnon <[hidden email]>:
I finally got a chance to try this change out - and this a super helpful change - thanks so much. (It also taught me where some of the things live in Pharo).

Why wouldn’t this change be made permanent in the live Pharo? I can’t see any downside and it really helps understand new code.

I think it is bad idea to replace current hierarchy view. 
With your solution it can be difficult to see superclasses chain of selected class when it is at the end of subclasses list. It will force user to scroll which is bad. With current approach this problem not exists.

But new view mode can be extra option accessible somehow from menu.
Reply | Threaded
Open this post in threaded view
|

Re: How to view hierarchy of multiple classes in a package?

Tim Mackinnon
Hi Denis - as an argument in favour, you would only see this view when you select the Hierarchy button (so its not the default) - and by pressing hierarchy, I would argue that you want to see a hierarchy of all the classes (like you see all the classes in non-hierchy mode) - if there is lots of scrolling then that might be a code smell to look into.

As an extra data point - dolphin and visual age both work this way (maybe even visual works?) and I never saw it as a problem - which is why I was surprised that Pharo is different - however I know you guys often think differently.

Tim

On 1 Feb 2017, at 13:22, Denis Kudriashov <[hidden email]> wrote:


2017-01-05 12:11 GMT+01:00 Tim Mackinnon <[hidden email]>:
I finally got a chance to try this change out - and this a super helpful change - thanks so much. (It also taught me where some of the things live in Pharo).

Why wouldn’t this change be made permanent in the live Pharo? I can’t see any downside and it really helps understand new code.

I think it is bad idea to replace current hierarchy view. 
With your solution it can be difficult to see superclasses chain of selected class when it is at the end of subclasses list. It will force user to scroll which is bad. With current approach this problem not exists.

But new view mode can be extra option accessible somehow from menu.

Reply | Threaded
Open this post in threaded view
|

Re: How to view hierarchy of multiple classes in a package?

Denis Kudriashov

2017-02-01 14:56 GMT+01:00 Tim Mackinnon <[hidden email]>:
Hi Denis - as an argument in favour, you would only see this view when you select the Hierarchy button (so its not the default) - and by pressing hierarchy, I would argue that you want to see a hierarchy of all the classes (like you see all the classes in non-hierchy mode) - if there is lots of scrolling then that might be a code smell to look into.

Tools are just tools. They help to work with any system, no matter is it smells or not. And if switching to hierarchy will not show me superclasses just in the face I would said it is bad tool or at least not right tool which I want. 
I do not say that your tool with hierarchy of all classes is bad. It should be very useful like you said. But it is just different tool.
Reply | Threaded
Open this post in threaded view
|

Re: How to view hierarchy of multiple classes in a package?

Denis Kudriashov
In reply to this post by Tim Mackinnon

2017-02-01 14:56 GMT+01:00 Tim Mackinnon <[hidden email]>:
As an extra data point - dolphin and visual age both work this way (maybe even visual works?) and I never saw it as a problem - which is why I was surprised that Pharo is different - however I know you guys often think differently.

There was screenshots in this discussion. VA and VisualWorks has no such hierarchal view.
Reply | Threaded
Open this post in threaded view
|

Re: How to view hierarchy of multiple classes in a package?

Denis Kudriashov
In reply to this post by Tim Mackinnon
Hi Tim.
Just remembered this thread.

In latest Calypso you are able select multiple classes and switch to hierarchy. It will show "composite" hierarchy of all classes instead of single one.
So if you select all classes (cmd+a) you will get desired behaviour,


2016-12-27 17:44 GMT+01:00 Tim Mackinnon <[hidden email]>:
Hi guys - I'm trying to get back into pharo, and check out the advances in v5.

Anyway, if I look at a package in the system browser, it shows me classes in that package (i think my terminology is right here?).

What confuses me, is his I can see the hire hybrid the classes in relation to each other? The hier button just shows the hierarchy of the selected class and not in relation to the others?

I'm sure at some point pharo and squeak let you see the related hierarchies of all the classes in the package didn't it?

This is really useful to help understand the relationship between classes and pure risky identify useful refactorings.

I can't see how to do this in pharo anymore?

Is this functionality that has been lost (which seems a shame)? Or am I missing another useful browsers?

Tim

Sent from my iPhone


Reply | Threaded
Open this post in threaded view
|

Re: How to view hierarchy of multiple classes in a package?

Denis Kudriashov

2017-07-07 17:52 GMT+02:00 Denis Kudriashov <[hidden email]>:
Hi Tim.
Just remembered this thread.

In latest Calypso you are able select multiple classes and switch to hierarchy. It will show "composite" hierarchy of all classes instead of single one.
So if you select all classes (cmd+a) you will get desired behaviour,

Look:



Reply | Threaded
Open this post in threaded view
|

Re: How to view hierarchy of multiple classes in a package?

Tim Mackinnon
That's awesome and it reminds me that I need to make a baselineof for all my fav tools so that I load them when I grab a new image, as I don't have calypso loaded on my lambda experimental image.



Tim

Sent from my iPhone



Sent from my iPhone
On 7 Jul 2017, at 16:55, Denis Kudriashov <[hidden email]> wrote:


2017-07-07 17:52 GMT+02:00 Denis Kudriashov <[hidden email]>:
Hi Tim.
Just remembered this thread.

In latest Calypso you are able select multiple classes and switch to hierarchy. It will show "composite" hierarchy of all classes instead of single one.
So if you select all classes (cmd+a) you will get desired behaviour,

Look:
<CalypsoCompositeHierarchy1.png>
<CalypsoCompositeHierarchy2.png>

12