Magritte descriptions in hierarchies of classes

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

Magritte descriptions in hierarchies of classes

Miguel Enrique Cobá Martínez
Suppose I have a hierarchy like this:

Object subclass: #ClassA
        instanceVariableNames: 'name'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Example'

ClassA subclass: #ClassB
        instanceVariableNames: 'bInstVar'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Example'

ClassB subclass: #ClassC1
        instanceVariableNames: 'c1InstVar'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Example'

ClassB subclass: #ClassC2
        instanceVariableNames: 'c2InstVar'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Azteca-Model'

ClassA is just an abstract parent with the common functionality for the
other classes. Same for ClassB.
Only objects from ClassC1 and ClassC2 are to be created.

Should I create a "descriptionName" method in the class side of ClassA
to be inherited for ClassC1 and ClassC2 or should I create a
"descriptionName" once for each of ClassC1, ClassC2.
The same question about the inst vars for ClassB.

Summary, when you have a previously created hierarchy of classes and you
are trying to refactor code (deleting duplicated code and replace it
with magritte) how should you proceed?

It is valid to inherit the descriptions of parent classes?

What if for ClassC1 name should be displayed as 'Name' and for ClassC2
should be displayed 'Title'?

Regards,
Miguel Cobá

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki