ZClass not in a Product
Is there any good reason why a Product inside the ControlPanel is the only place a ZClass can exist? Why can't I have one in any folder? ---- Dylan Jay mailto:djay@avaya.com Avaya Communication Tel: +61 2 9886-8961 Level 3, 123 Epping Road FAX: +61 2 9352 9224 Nth Ryde NSW 2113 Mobile: 0409 606 171 AUSTRALIA
Is there any good reason why a Product inside the ControlPanel is the only place a ZClass can exist? Why can't I have one in any folder?
I think it is perfectly logical that ZClasses are located in the Products area. A folder is for instances of classes, and a ZClass is a class, not an instance.
Joachim Werner writes:
Is there any good reason why a Product inside the ControlPanel is the only place a ZClass can exist? Why can't I have one in any folder?
I think it is perfectly logical that ZClasses are located in the Products area. A folder is for instances of classes, and a ZClass is a class, not an instance. I do not agree with you:
a ZClass is both an instance (you can manage, modify, delete) and a class (you can use as blueprint for object creation). Dieter
I do not agree with you:
a ZClass is both an instance (you can manage, modify, delete) and a class (you can use as blueprint for object creation).
O.k., I CAN manage/modify/delete a ZClass, but it still is (conceptually) a class, and only a class. You can manage/modify/delete Zope Python classes, too: Add new icons, DTML or "real" methods etc. It just is done from the file system. Still nobody would call those "instances" ... Or did I miss something here? Joachim
Joachim Werner writes:
I do not agree with you:
a ZClass is both an instance (you can manage, modify, delete) and a class (you can use as blueprint for object creation).
O.k., I CAN manage/modify/delete a ZClass, but it still is (conceptually) a class, and only a class. You can manage/modify/delete Zope Python classes, too: Add new icons, DTML or "real" methods etc. It just is done from the file system. Still nobody would call those "instances" ...
Or did I miss something here? Maybe you search "python.org" for Guido's metaclasses article. It tells that a Python class can be both a class and an instance and that this view has interesting applications.
You focus on the class aspects of a ZClass (a pattern for creating instances providing them with basic common infrastructure), while I stress the instance aspects. The fact, that you can manage ZClasses in the same way as other Zope objects, calls for similar structuring possibilities: taking them out of the centralized control panel and putting them anywhere in the site. That was the starting point of our discussion... Dieter
Maybe you search "python.org" for Guido's metaclasses article. It tells that a Python class can be both a class and an instance and that this view has interesting applications.
You focus on the class aspects of a ZClass (a pattern for creating instances providing them with basic common infrastructure), while I stress the instance aspects.
The fact, that you can manage ZClasses in the same way as other Zope objects, calls for similar structuring possibilities: taking them out of the centralized control panel and putting them anywhere in the site. That was the starting point of our discussion...
I know about the "duality" of Python classes. I just don't see what I could really do with a ZClass in the "instance space" (reading this twice, see below for some possible examples). A totally different aspect is whether Zope should have something like an in-built support for "virtual instances", i.e. sub-folders could be like full Zope instances, providing a local Products directory etc. THAT would make a lot of sense to me. But in general I am more in favor of getting things OUT of the instance folders than getting more stuff in. It makes absolutely no sense to me why the Zope management interface displays database adaptors, user folders, and actual content objects all in the same folder. The only thing these objects have in common is that they are living in the same namespace. Another problem ist that the Add lists get longer and longer. So why not have a separate tab for users, content, and technical things like database adaptors, or SiteRoots? O.k., what we get then is too many tabs, what there should be a clever way of changing the ZMI to a multi-level tab concept (main tabs and sub-menus). To come back to the ZClass question: I see and use them mainly as templates. That's what they are good for. So they should reside in a template folder. Right now, this folder is the Products folder. Maybe we need local Products/Templates folders, so that it is possible to have ZClasses that just work locally or that overload a base ZClass defined up in the tree. But what we definitely don't need is freely floating ZClasses. Another problem is that the ZClass implementation is really "experimental". They work great, which is a miracle, but they are extremely slow, and a lot of things you'd need for effectively sub-classing ZClasses from others don't work. E.g. it is impossible to overload existing properties/porpertysheets, and acquisition does not work as expected either. Joachim
Joachim Werner writes:
I know about the "duality" of Python classes. I just don't see what I could really do with a ZClass in the "instance space" (reading this twice, see below for some possible examples). A totally different aspect is whether Zope should have something like an in-built support for "virtual instances", i.e. sub-folders could be like full Zope instances, providing a local Products directory etc. To clarify, you use "instance" here in the spirit of "Zope instance" a-la "INSTANCE_HOME" and not in the sense of "instance" of a class...
That would probably be a good thing.
I am more in favor of getting things OUT of the instance folders than getting more stuff in. That is completely different from what I would like to do.
It makes absolutely no sense to me why the Zope management interface displays database adaptors, user folders, and actual content objects all in the same folder. It makes lots of sense for me!
Consider a large site hosting many applications, partly developed and maintained by different people/departments. It is very nice to be able to structure the site hierarchy into folders corresponding to appliciations and allow each team responsible for an application to put in everything they need for the implementation: database adapters, additional user definitions, special roles, ZClasses, .... Zope already allows this partially. Unfortunately, the product registry is global and not managed similar to user folders. Your proposed "virtual instances" would be an alternative solution. I could live with it, though I would not think it is better.
.... To come back to the ZClass question: I see and use them mainly as templates. That's what they are good for. So they should reside in a template folder. Right now, this folder is the Products folder. Maybe we need local Products/Templates folders, so that it is possible to have ZClasses that just work locally or that overload a base ZClass defined up in the tree. But what we definitely don't need is freely floating ZClasses. I am much in favor to structure objects *NOT* according to type (e.g. all images in a folder, all SQL methods in a folder, all Scripts in a folder, ...) but according to applications/services:
One folder for each service which contains everything needed only for this service: images, scripts, SQL methods, content, ZClasses, .... There are things that are used more globally. They may go into type specific folders.
...
Dieter
participants (3)
-
Dieter Maurer -
Jay, Dylan -
Joachim Werner