[squeak-dev] ClassOrganizer and classifyAllUnclassfied
Marcel.Taeumel at hpi.de
Mon Dec 10 12:44:23 UTC 2018
Yes, ClassOrganizer knows about classes and thus also about
#withAllSuperclasses. Putting the #classifyAllUnclassified code into
ClassOrganizer improves the support for tests and scripts.
Yet, the name "classifyAllUnclassified" is ambiguous. Why not keep the name
"categorizeAllUncategorizedMethods"? It is an organizer that manages
categories. What about "categorizeAllUncategorized"? Such a method could
exist for other organizers as well, using some other rule.
In general: +1
> Hi all,
> while going through categories I naturally came by the source code for
> categorizing all uncategorized messages through the context menu in the
> Browser (Browser>>#categorizeAllUncategorizedMethods). I found that that
> method implemented the logic of classifying methods which I found odd as
> this sounds like something the class organizer should take care of. Thus,
> I rewrote the two classes to the code below:
> "Categorize methods by looking in parent classes for a method category."
> self classOrMetaClassOrganizer classifyAllUnclassified.
> self changed: #messageCategoryList
> | organizers |
> organizers := self subject withAllSuperclasses collect: [:ea | ea
> (self listAtCategoryNamed: ClassOrganizer default) do: [:sel | | found |
> found := (organizers collect: [ :org | org categoryOfElement: sel])
> detect: [:ea | ea ~= ClassOrganizer default and: [ ea ~= nil]]
> ifNone: .
> found ifNotNil: [self classify: sel under: found]].
> Does anyone have any opinion on that? I really prefer that version but I
> wanted to check first if there is a good reason not to have this in the
> P.S.: I also just noticed a weird inconsistency in the naming scheme
> between categorizing (Browser) and classifying (Organizer).
Sent from: http://forum.world.st/Squeak-Dev-f45488.html
More information about the Squeak-dev