home contents changes options help subscribe edit (external edit)

Introduction

ZClasses are a Zope 2 based through-the-web rapid development class templates introduced with early Zope. They are very polarizing. Some people hate them, some people love them. They are easy to get started with but hard to maintain, and although still supported, most people consider them deprecated. Still the right solution for some people, nevertheless?

As of Zope 2.10, ZClasses are deprecated , for the lack of people who really know ZClasses internals.

So those of us who want to use ZClasses, have a very hard choice to make. Stay with a broken ZClass implementation, fix ZClasses and break Zope 2 and fork the Zope tree, or write a new version of ZClasses in Zope 3 and leave our legacy applications behind.

At the end of this page, under Future Directions, is a description of what I am doing to upgrade ZClasses. I already have field objects. They define the fields in a ZClass. I use them to generate tables of objects, display table headers, generate edit forms, generate and populate Formulizer Forms. Soon I will be using them to generate Javascript Validations. Send me an email if you want to talk about this stuff lozinski@freerecruiting.com

Problems with ZClasses.

ProblemsWithZClasses Here are the list of reported problems with ZClasses. Or a more strongly worded page ZClassesAreEvil.

One of the biggest conceptual problems with ZClasses is that they do not have instance variables. Instead one adds instance variables to a propertysheet. I now understand the reason for this. In an email on the zope-dev mailing list:

Dieter Maurer wrote:

>The main reason is that Zope only learned with Zope 2.8 how to >protect attributes with elementary values. >

Without protection on instance variables, it made no sense to support them in ZClasses. With protection on instance variables, ZClasses can be fixed to have proper instance variables.

Alternatives to ZClasses

AlternativesToZClasses Here are some of the other options to consider if you are thinking of using ZClasses.

About ZClasses

Here is more information about ZClasses

Screencast: Simple content type with ZClasses

Zope 2 Book Read the chapter on Extending Zope.

ZClasses have a list of allowed subobjects. It would be conceptually easier to create that list in the subobject. The problem is that when creating a list of objects to be added, you need that list. So we can upgrade them to make subobjects define their allowed superobjects. Then automatically add that to the superobject definition, so that it is available at create time.

Evidently ZClasses also have class methods, but they are shared among all ZClasses. That should be also be fixable.

Future Directions

Here is my best proposal at upgrading ZClasses. It avoids the problems with upgrading ZClasses Send me an email if this interests you lozinski@specialtyjobmarkets.com

Plan B is to make a regular Zope product, for the 300 classes I want to put up for another 300 specialty job markets, which will involve 300 custom classes, so I really have to do automatic generation of Zope Classes. I don't get a choice. That does not address the issue of all the other ZCLasses? I need.

PLAN C is to do my business modelling in a separate ZODB application, with a few hooks into Zope 2. I am taking it off site, since it is not really a zope proposal. You can read more here about what I am doing in business modelling.

Plan D is to get in and figure out the ZClasses source code and fix it in future releases. Not the easiest thing to do. Maybe I need to show up at some sprints to figure out the inner workings of the Product Registration stuff in Zope 2.

You can see it is not quite clear what to do.

And then here are some other older proposals, none actively being worked on.

And here is another proposal.

And Yet another Proposal

And here is an even better proposal

OTHER SITES

Here is a posting in response to my poking at this issue.

I did go ahead and read the ZClasses source code. Way too complex for me to easily figure out. There is just too much stuff in Zope for modelling a business.

This page was mostly written by Christopher Lozinski lozinski@specialtyjobmarkets.com



subject:
  ( 35 subscribers )