Why not do it like in Cocoa? http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Cocoa... On Thu, Apr 7, 2011 at 9:26 PM, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> wrote:
2011/4/7 Alain Plantec <alain.plantec@yahoo.com>:
Le 07/04/2011 19:23, Igor Stasenko a écrit :
button1 model: (self for: #performAction adapt: #turnRed) button2 model: (self for: #performAction adapt: #turnGreen)
yes, cool! It seems to be a good way to clean morphic cheers Alain
Yes, it's delegating the job to specialized objects. Specialized objects shall know how to. That should prevent Morphs to be omniscient.
My favourite name for the opposite pattern is "god programming": we all encountered the thousand lines functions with tons of imbricated if/switch logic in C or C// world, didn't we ?
Somehow, Igor proposal reminds me the VW UI architecture were they pushed the wrapper pattern very far. Personnally, I found myself comfortable with it, but it had its detractors too. It would be interesting to analyze their arguments.
cheers.
Nicolas