[REBOL] Business Object Versioning
From: robert:muench:robertmuench at: 5-Apr-2002 10:42
Hi, my current applications uses object! to define a set of business objects the
application than manipulates. While further developing the application the
definition of those objects might change. New releases need to update the older
business objects on-the-fly to keep it as simple as possible for the user. To be
able to do this I have a migration function that transforms an old object step
by step to the newest version. The pattern is like this:
migrate: func [...] [
if old_object/business_object_version = 1.0.0 [
; update to 1.1.0
]
if old_object/business_object_version = 1.1.0 [
; update to 1.2.3
]
...
]
What needs to be done to update an object? Well, there are only four things:
1. Add a new variable and value to an object
2. Rename a variable in an object
3. Delete a variable from an object
4. Set a different value for an existing variable in an object
I really would like to have object manipulation functions for 1, 2 and 3. Where
1 can be solved by short function;-).
Does anybody has a good idea how to do 2. and 3.? Robert