[Seaside] Join forces
renggli at gmail.com
Tue Aug 29 20:34:33 UTC 2006
> > Each time I ask people about shoreComponents they told me that they
> > were not
> > usable as any other seaside components and I found that sad. because
> > we need
> > a library of standard reusable components. So what you are doing is
> > important.
> Yes, this was the most painful decision during desing of
> ShoreComponents. But the changes had IMHO very good reasons and they
> were done for better reusability of this components. The main change
> is adding of obligatory parent reference that enables to control the
> components hierarchy, use embedded forms etc.
In my opinion it is exactly this parent reference that makes them
*less* reusable. It creates a strong coupling in the component
hierarchy and turns them unuseable in any other context/framework not
following that pattern.
> The big problem is that every bigger set of components use own basic
> component class - and the main motivation is to do not break the old
> code. ShoreComponents adds parent reference and attributes and
> overrides constructors, Magritte overrides constructors etc.
It is good practice to always call "super initialize" if you override
the instance side of #initialize. Even SmallLint points that out, if
you miss it. If you follow that pattern (Magritte does) it should be
no problem to have full reuse.
More of a problem for Magritte is that it was using the selectors
#description and #asComponent for different things than recently
introduced by Seaside.
> So we should find another approach that will help us to use one
> extensible basic class for all this projects with stable protocol.
> Maybe some handy design pattern for that.
Instance-variable extensions? ;-)
More information about the Seaside