[Zope] Zope design: the liberal use of subclassing?
Michel Pelletier
michel@digicool.com
Tue, 18 Jan 2000 11:47:17 -0500
> -----Original Message-----
> From: Darran Edmundson [mailto:dee124@rsphy1.anu.edu.au]
>
> One component of our budding academic site is a
> searchable database of publications authored by
> department members. Publications come in various
> flavours: journal articles, conference proceedings,
> books, book chapters, etc. All of these share
> certain properties while others are unique.
Sounds like inheritance.
> Question: In terms of ZClasses, is it best to create
> an abstract Publication ZClass with common data
> and methods and then subclass the various flavours?
It's a philosophical issue, but I would say that soulds like a good
plan.
> In addition to publication details, I also want
> the option of encapsulating the data files, be it in
> PDF, MSWord, ASCII, TeX format, etc.
You want Zope to *interpret* their content somehow? Or just have nifty
labeled File objects?
> Question: Rather than create a slew of File-like
> products in the root Product folder, should I again
> create an abstract class and subclass for each
> Mime type a la the PDF example used in:
> http://www.zope.org/Members/lstaffor/zProperties
Zope's file object allready has mime-typeablity and storage, if you
don't want to parse/interpret the contents of a special file I don't see
why you can't just use the stock file object.
>
> The same applies for People, variants of which
> include staff, students, alumni, visitors, etc.,
> with the difference that people can migrate from one
> class to another (student to alumni).
Do you want these people objects to also participate in
authentication/authorization? In this case you should go with standard
Zope user objects and Roles.
-Michel