[MCP][Q] Classes referencing their own subclasses

German Morales germanmorales at delta-sys.com
Sun Feb 23 02:07:29 UTC 2003


Hi everybody,

On the Swiki page of the Morph Cleaning Project
(http://minnow.cc.gatech.edu/squeak/3005), Daniel Vainsencher wrote:

"one of the things that makes Morph the hub of a big tangle, is the fact
that it references classes it shouldn't know, for example, alot of it's
own subclasses".


To see how much Morph refereced their own subclasses, I wrote the
following script (enhancements welcome):


Transcript show: 'Classes referenced by their Superclasses'; cr.

Morph allSubclasses do: [:eachClass |
 allCalls _ Smalltalk allCallsOn:
   (Smalltalk associationAt: eachClass theNonMetaClass name).
 allReferencingClasses _ (allCalls collect:
   [:each | Smalltalk classNamed: each classSymbol]
   ) asSet.
 allReferencingSuperclasses _ allReferencingClasses select:
   [:each | eachClass allSuperclasses includes: each].
 allReferencingSuperclasses do:
   [:each | Transcript show: eachClass; show: ' --> '; show: each; cr].
].


The result is this BIG list:

Classes referenced by their Superclasses
TTSampleStringMorph --> TTSampleFontMorph
ObjectPropertiesMorph --> Morph
StackMorph --> Morph
Viewer --> Morph
LineMorph --> BorderedMorph
LineMorph --> PolygonMorph
StringMorph --> Object
StringMorph --> Morph
BalloonMorph --> Morph
SketchEditorMorph --> Morph
StandardViewer --> Object
StandardViewer --> Morph
SimpleButtonMorph --> Morph
ImageMorph --> Morph
SyntaxMorph --> Morph
MovieClipEndMorph --> MovieClipStartMorph
SystemWindow --> Morph
EToyGateKeeperMorph --> EToyCommunicatorMorph
ListViewLine --> Morph
ColorPickerMorph --> Morph
ScriptEditorMorph --> Morph
TileMorph --> Object
AlignmentMorph --> Morph
HandleMorph --> Morph
HandleMorph --> BorderedMorph
MovieMorph --> Morph
SketchMorph --> Morph
TextPlusPasteUpMorph --> Morph
TrashCanMorph --> Morph
TwoWayScrollPane --> Morph
URLMorph --> Morph
PasteUpMorph --> Morph
ButtonPropertiesMorph --> Morph
CollapsedMorph --> Morph
PhraseTileMorph --> Morph
GraphicalMenu --> Morph
TransformationMorph --> Morph
HandMorph --> Morph
TextPropertiesMorph --> Morph
IconicButton --> Morph
BookMorph --> Morph
MorphThumbnail --> Morph
TextMorph --> Morph
MenuMorph --> Object
MenuMorph --> BorderedMorph
MenuMorph --> Morph
HaloMorph --> Morph
MVCWiWPasteUpMorph --> Object
MVCWiWPasteUpMorph --> Morph


Now the question: Bug or Feature?

Is it OK for a Framework? I'd answer yes in general, but we should go
through the list and analyse each case. As an example, try the same for
Collection instead of Morph: you will get a long list too.

Waiting for comments...

enjoy!

German Morales






More information about the Squeak-dev mailing list