On Jun 11, 2010, at 2:04 PM, Hilaire Fernandes wrote: > Hi Fernando, > > Sure we can be more optimal in execution term, but it is not my > objective. I want the example to be concise and optimal under this term, > so smaller then may be easier to catch. >
Hi Hilarie, i was not speaking of optimization. Just pointing out the miss use of the pattern , conceptually. Which i think when writing tutorials is important. Lazy initialization is conceptually used when the internal collaborator is hard to initialize and maybe would never be used. Which is not the case with the window, toolbar, etc Please don't take the wrong way, just wanted to point out the design problem. I think you have done a great work by coding a tutorial, which i found very useful for building a Gaucho control panel for the next version. Fernando > > > Hilaire > > > > Fernando olivero a écrit : >> Hi Laurent, great work! We need more documentation! >> >> Just a little coding style i would like to point out. >> >> I see you are using lazy initialization, but in this case i believe its >> a miss-use of the pattern. >> Because you always will have a toolbar and a menu bar, since the >> creation you are sure you need them, why not go and just initialize them >> before installing. >> >> Let me know what you think. >> >> >> So i propose changing the implementation to : >> >> initialize >> super initialize. >> self initializeMenuBar. >> self initializeToolbar. >> .... >> >> and >> >> initializeMenuBar >> | menu | >> menu := self window newMenu. >> menu >> addToggle: 'Load' >> target: self >> selector: #load. >> menu >> addToggle: 'Save' >> target: self >> selector: #save. >> menubar := self window newToolDockingBar. >> menubar >> add: 'File' >> font: self window theme menuBarFont >> icon: nil >> help: 'File operations' >> subMenu: menu. >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Pharo-project mailing list >> [email protected] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [email protected] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
