[Seaside] [OT] Case insensitive comparison not stable ?

Francois Beausoleil francois.beausoleil at gmail.com
Wed Jan 11 20:39:28 CET 2006


Hi !

2006/1/11, Ramon Leon <rleon at insario.com>:
> > But pay attention using subclassing instead of subtyping is
> > not really a good style.
> > I have problem to see why authorRepository is a Set, sure it
> > can be implemented as a set...
> > but it does not have the same interface than a set to my taste.
> >
> > Stef
>
> I agree, you might find that later you need it to be a TreeSet or a
> BTree in order to use with an object database, and your clients are
> bound to the interface of Set preventing you from changing the
> superclass.  So rather than using inheritance, use composition, have
> your repository include a set as a member variable, to hide the
> implementation, and simply delegate only those protocols a repository
> needs to the internal collection, because you will need to change it
> later.

You are both right.  This is a toy application at the moment, and I
wanted to get off the ground faster.  I have about 20 lines of code
for models, so it shouldn't be too hard to rewrite using composition
:)

Thanks !
--
François Beausoleil
http://blog.teksol.info/


More information about the Seaside mailing list