Hello guys,
do you remember my work on classes and objects?
I fear the answer is "no" :)
Anyway, I have been working on some other critical projects so I haven't
been able to work on that for some time.
But, now I have restarted my study for my current needs.
The idea was to provide a simple way to manage classes, to delete/restore
class properties and to synchronize objects with these classes.
As I was not really happy about the result of my previous work based on
class versioning (I found it too much intrusive in XWiki code and
complicated), I totally changed my approach into something much lighter.
The idea is really simple:
I propose to add the feature of enabling/disabling class properties.
* If you disable a property, it is only "hidden" without being deleted so
you can modify the structure of the class without losing anything.
* Then the disabled properties are also "hidden" for the objects
instantiating this class and the valued fields are also not lost.
* If you add a new property to the class, all objects will inherit a new
field with the default value.
* If you enable a disabled property, all the objects owning the field
re-find it and the objects not having the field now have it with the default
value.
* you could also delete a disabled field from an object for some
optimization issues.
I also propose to add the "remove property" feature which would be quite
protected but which is useful: you simply delete the property from the
class.
* All objects having the "removed" field are no more synchronized with the
class.
* the removed field still exist in the object but is no more available to
classical display functions which use "class properties" to find object
fields.
* the removed field can be deleted from the object to resynchronize the
object to the class
* if a new property with the same type and name is re-added to the class,
the object re-finds its existing field.
The way to do it is quite simple: just add a "enabled" field to the
PropertyClass and manage it in the code.
I have modified a bit XWiki-Core and some velocity scripts but it seems
really light without any really new logic
Are you interested in this?
best regards
Pascal