#smalltalk #refactoring Question!

I have a method:

drawFlows: someFlows onto: aMorph (someFlows size > 2) ifTrue: [ self drawManyFlows: someFlows onto: aMorph ] ifFalse: [ self drawSingleFlow: someFlows onto: aMorph ]

Now: Do I want to get rid of the dispatch by subclassing? But then do the dispatch where? In the constructor? Or add a factory?


Double dispatch will look like
someFlows drawInto: aMorph
And you subclass indeed

Inscrivez-vous pour prendre part à la conversation
Mastodon Chapril

Chapril, membre du collectif CHATONS, un projet de l'April.