[Zope3-dev] Content Types: What are they? Do we need them for
Zope 3
Gary Poster
gary@modernsongs.com
17 Nov 2002 20:02:31 -0500
On Sun, 2002-11-17 at 12:48, Casey Duncan wrote:
> I think that we must have some mortal-readable name given to "types". IMO, in
> Zope3 terms a type is described through an interface.
+1 (as a general observation that we already have the guts of this in
interfaces and any solution should--must, IMO--be strongly based on
them) ...and...
> Therefore it would seem
> that an "object type" (I hesitate to use the word content here, what about
> objects that aren't related to content?) is simply a friendly "display name"
> for a single interface.
> Now, this is quite a different thing from a meta_type. Since meta_types
> classically denote a single class. As Stephan points out, if we use
> interfaces to denote types, then an object can be simultaeously an image and
> a file.
>
> This is not a bad thing, except how does one sort objects by type? With
> explicit being better than implicit I imagine that when registering content
> you should be able to declare a single interface as the "type" of the
> content. This interface should of course be implemented by the objects
> created by the factory (this could be enforced by the framework). In a
> separate declaration, you would specify the friendly name for the interface
> to be read by non-programmers.
>
> For instance:
>
> <type interface=".Image.IImage" title="Image" description="An Image File" />
>
> <content class=".Image." type=".Image.IImage" />
> ...
>
> Perhaps this could supplant the title and description we currently give to the
> factory declaration inside content. It seems that the current business of
> declaring it on the factory only helps us in creating objects, not
> identifying objects that already exist. This could take care of both.
...+1 (as a more specific suggestion and solution) except I'm not sure
about the implications of the last paragraph.
Gary