[Zope-CMF] Extending portal types: Subclass default type or create a ZClass ?
Dieter Maurer
dieter@handshake.de
Sun, 21 Jul 2002 23:20:22 +0200
Jeffrey Franks writes:
> What is the determining factor that causes one to create
> a ZClass instead of subclassing a default type?
ZClass' property sheet support is strong.
It can be done through the Web (TTW).
Subclassing requires more modification, especially in
not-TTW code.
> I have a requirement whereby it looks like the default file
> class could be subclassed, and just add several attributes
> and provide edit and view of these. One of the attributes needs
> to be a select one-of-a-list of fixed items. However, two
> other new fields need to reference a table (or list?) of n,
> where user adds items to the table.
>
> Can I get away with just sub-classing the default file type
> and adding these items for view and edit? Or, do I need to
> create a ZClass?
I expect, you can do everything through sub-classing what
you can do with a ZClass.
It just can be more work. (There are people who do not like
ZClasses at all)
> What is the determining factor that moves one to use one over
> the other?
I use ZClasses for small not-to important projects (because
development is fast).
I use full fledged Python products when the project is more
essential and will probably need several rounds of enhancement
and upgrades.
Dieter