[Zope3-dev] An small idea for the future: Strategy pattern for the formulator fields.

R. David Murray bitz@bitdance.com
Tue, 16 Apr 2002 10:44:33 -0400 (EDT)


On Tue, 16 Apr 2002, Lennart Regebro wrote:
> I find this highly annoying. Would it be possible to adapt a strategy
> pattern for future formulator fields, maybe the one that gets merged into
> Zope3, so that the type of the field is a setting instead of an object?
> Especially if properties is going to be made with "Zope 3 core formulator"
> (which I understand is the idea).

Well, currently in Z3 you "declare" the fields in your on-disk files, so
changing the type is pretty easy.  Different Fields have different
Interfaces, so having the type be a parameter conflicts with the
current design.  On the other hand, there's no reason the TTW
user interface shouldn't include a "copy-and-change-type" operation
that would preserve all parameters that are common between the
Interfaces of the two types.  Given Interfaces, this should be
pretty easy to implement.

--RDM