#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?


@ckeen not sure factory is pertinent here. In @drgeo I use factory just before instantiating geometric items, to check for redundancies and hold the items of the models

Inscrivez-vous pour prendre part à la conversation
Mastodon Chapril

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