Daemonite: Type Creation Tags dmCreateTypev2 for Spectra Archive

Daemonite: Type Creation Tags dmCreateTypev2 for Spectra Archive


Saturday, July 20, 2002
Type Creation Tags dmCreateTypev2 for Spectra

Daemon type creation scripts (dmCreateTypev2) enable developers to evolve the object model. If you need to create, modify, add or remove methods or properties on a type, build your types with these tags.

In standard Spectra there are three ways to modify Object Type Definitions:

  1. using the webtop wizards (akin to being licked to death by goats)
  2. importing/exporting WDDX packets of Type definition information (similar to fitting a round peg into a square hole)
  3. using PITA tags to script the run-once deployment of a type definition (the acronym for PITA escapes me but it is roughly translated Pain In The Ass)

The issue with all of these methods is evolving a Type definition when you already have a bundle of content object instances of that type in the system.  If you add a property, for example, that property only exists in newly created or updated object instances.  You have to either write a script to update or delete these objects or alternatively code conditions in your handlers to accommodate the presence or absence of legacy properties.

The dmCreateTypev2 library of tags enables developers to effectively script the deployment of types.  But more importantly these scripts can be run as often as you like and will provide intelligent options for updating the existing content object instances of the type you are updating.  Once you have this functionality it is hard to imagine life without it.

Installation

Just copy the tags into your custom tag directory.  Then you'll need to put together a type creation template for each of your types.  These creation scripts detail individual properties and methods in either dead simple custom tags or by passing in a preprepared structure.  Typically the creation scripts are kept under the webroot of your application during development and removed in production.

Download dmCreateTypev2 (16kb Zip)

The zip file includes several sample creation scripts to get you going.

If you have any difficulty with the tags or the documentation please post to the nm-spectra@lists.daemon.com.au mailing list for help.

Posted by modius at 11:39 PM | Permalink
Trackback: http://blog.daemon.com.au/cgi-bin/dmblog/mt-tb.cgi/26

Comments