>>> which shout the text if the model do not know #shoutAboutToStyle: >> >> No. The interaction is different: >> >> 1. TextMorph changes its contents. >> 2. TextMorph notifies its styler withe the morph and its model that >> there might be the need to style. >> 3. The styles does whatever it wants to do: >> - The null styler might ignore the request. >> - The ShoutStyler calls #shoutAboutToStyle: on the model to ask if >> and how to style (earlier versions also called #okToStyle before they >> called #shoutAboutToStyle:). >> - The ShoutStyler might also decide to auto format the text. I >> believe earlier versions of Shout could do that. > > Ok I have no idea how it was before and we never touched Shout. > So I will wait for alain because I'm more and more confused.
In other words, this is a double-dispatch where the type of the styler is revealed on the model. In case of Shout #shoutAboutToStyle: tells the model that Shout is ready to take further commands on how to style the input. This gives true extensibility and is also very efficient. Lukas -- Lukas Renggli www.lukas-renggli.ch