You are not logged in Log in Join
You are here: Home » Members » yacc » FlexData Content Object

Log in
Name

Password

 
 

Folder icon FlexData Content Object

What are FlexDatas?

FlexData are content objects derived from Folders. They can be used easily from page templates, DTML Methods or Python Scripts.

  • They support properties and subobjects.
  • They support storing objects of different types. (Actually this is called a subtype by me, because it's not a full blown ZClass)

Why did I write FlexData?

I needed a flexible content object during a project to create a Doctor Office Record Keeping Application. I've found myself using Kubes in ZODB as the data store. For the "subtype" motivation see my dispatcher design.

After wrestling with the Acquisition monster, and having won (in fact, if not morally :) ), FlexData's are probably the quickest way to develop data storing and handling apps in Zope short of creating a Product and going the ZClass/ python way.

The 0.0.0 release is intended as a technology demonstration, but it seems quite stable. It's developed against CVS-Zope (default HEAD branch), but it should work with 2.5.1 or even earlier versions. I'll propably also post some example app (the above mentioned app, but for the moment it's to much in flux).

I've tested using FlexDatas with DTML, PythonScripts and ZPT.

So how does the subtype support work?

Easy. When getting an attribute that does not exist in the FlexData instance, instead of directly acquiring the attribute, FlexDatas do this:

  1. try to acquire an object called like the subtype property value.
  2. try to get the attribute from this object.
  3. if one of the above steps fails, it just tries to acquire the attribute the normal way.

What does it give you? Well you get a record/struct with methods, but without inheritence (well at least without multiple inheritence). Just by creating a Folder called "NewsItem" in /, you can bestow methods and other properties upon all FlexData instances that have subtype set to "NewsItem".

Andreas

 Title   Type   Size   Modified   Status 
 Catalog-friendly release Edit object Software Release   2002-09-28 published
 Even more Catalog-friendly release Edit object Software Release   2002-10-02 published
 FlexData initial release Edit object Software Release   2002-09-23 published
 pure Acquisition based version (__of__) Edit object Software Release   2002-09-25 published
 Security info fixed Edit object Software Release   2002-10-04 published