Laments about Archetypes

Andy McKay laments about archetypes: part one and part two. The second part is an interesting read, because it talks about zope3 and the possibility of using xforms instead of archetypes. Good points by Paul Everitt:

The idea that a personnel record is encoded in a pickle, which requires a class to load, which might import a bunch of other software…I just think we need to explore alternatives. At the same time, in XML land there is a growing realization that schemas are being misapplied. A document shouldn’t conform to a schema. A document should be a document, and it might later be validated against a schema. But you can always look at the document even if there is no schema, or the document is invalid against the schema. In fact, you might want to look at a document through the lens of more than one schema. In one case, the employee record/instance might be an Employee. In another, a Team Member. Saying that you must have a functioning version of the Employee class installed just to look at the record should be re-visited, especially if your goal is to look at the record as a Team Member.

Zope 3’s idea of adapters is the right start. However, Zope 3 still wants to associate the record with some kind of basic class that has a defined schema, so that forms can be generated. I think a dumb-as-a-rock storage system is needed. Store everything as an instance of the Rock class. Make sure that you can always open a Rock instance. Don’t assign any schema to Rock. Don’t have any forms for Rock. However, expect everyone to immediately adapt Rock to Employee or Team Member or whatever. If Employee or Team Member don’t work anymore, because the type author quit the country and moved to France, you can still get at the data. Yeh, not very object oriented. In a case like this, the logical next step is to question why a pickled Rock should be the unit of storage. Here’s a basic question: how many people would expect a DTML Document in a Zope 2.7.3 Data.fs to be importable in Zope 2.1 using Python 1.5.2? My guess is that most people would be surprised if this was possible.






Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.