Hi,
Starting with the original version of Glamour, we had the opportunity to define custom
browsers through GLMBrowserTemplate. All you had to do was to override buildBrowser and
construct your browser.
For example:
GlamorousBrowser>>buildBrowser
browser := GLMFinder new.
...
^ browser
I disliked this solution since a while. One reason was that embedding a browser into
another one was inelegant because you had to say:
a custom: GlamorousBrowser new browser
instead of simply:
a custom: GlamorousBrowser new
So, now, we can achieve this by subclassing the browser from GLMCompositePresentation and
overriding compose. And because the GLMCompositePresentation also contains the fluent API,
you can script the browser in a fashion that is more consistent with the rest of the
scripts. So, the example code would become:
GlamorousBrowser>>compose
self finder with: [:finder |
... ]
The change might seem small, but to me it is significant.
If we want to get people to program Moose, it must feel elegant to do so. And to reach
this goal I think it is essential to strive to eliminate any unneeded concepts. Even if
they are small.
Cheers,
Doru
--
www.tudorgirba.com
"One cannot do more than one can do."