thanks ;)
Don't worry, I wish I could document as well each time but often I can't
spend the time to do so well :)...
Generally, I spend my time trying to deliver a new version of a server for
yesterday :)... Sometimes, I wonder whether documentation is not something
like a ancient myth, a forgotten knowledge that our ancestors were mastering
but that we have lost :)
This time, as I'm beginning with XWiki, digging in a code which doesn't
belong to me and doing some reverse engineering and then trying to involve
my ideas into existing code, I wanted to document clearly for you and also
for me.
See below...
regards
Pascal
On 4/17/08, Ludovic Dubost <ludovic(a)xwiki.org> wrote:
Hi Pascal,
Very cool demo ! I wish the XWiki core developers (including me) would
document features that well !!
This sounds really cool. I have one question:
How do you automatically upgrade an object to the latest version of a
class ?
I have the feeling that this could make life complex for users for the
case happening most time (adding properties over time).
I totally agree with you... I don't want end-users to be lost in objects and
class versions... This is why we should foresee all the
usecases and then make everything as easy as possible...
But as we say in French:"qui peut le plus peut le moins"=Who can do the more
can do the less...
I'm wondering if a way to handle this would be to
do a merge between the
class as it was when the object was last created/updated and the way it
is now. Basically when you save you ask the user if he wants to
"upgrade" the object of there are any changes to the class definition
that go beyond adding properties or when the changes have storage impact.
Are you speaking about saving the object or the class?
Would the upgrade be proposed when you save the object or when you save the
modified class ?
I agree that adding a property is not a problem for automatic upgrade... you
don't lose any existing info... the problem is for property deletion or
update...
But, in the case of automatic upgrade when saving the class, imagine the
case you have a document containing lots of objects and you want to keep
these objects as they are... But you add a property to the class and then
all the objects are automatically upgraded... Is automatic upgrade good for
this case?
Now this would mean automatic upgrading if changes are
only cosmetic
(which could be different in some cases from the desired effects).
is adding a property only cosmetic?
Woud it be better to control the upgrade from objects or from classes... In
fact, I don't have a clear answer: both cases might be useful...
Maybe, as you said, when you modify a class, we could propose to the user to
upgrade all the objects in a row or maybe to choose which objects he wants
to upgrade but if there are lots of objects???... or maybe to choose the
documents in which he wants the objects to be upgraded?
I wonder if a class/object manager module could not be interesting to
provide clever tools...
The target is now a problem of ergonomics :)
It's great to see people dig into this part of the
code.
Ludovic
Pascal Voitot wrote:
Hello folks,
finally I found some time to deploy a demo environment and write some
explanations about my work...
go on
http://myxwikidemo.dyndns.org:8080/xwiki and click on "improve
class
properties management" to access the text
presentation and the demo
guide...
Sorry for the long text but it also helped me
structure my thinking...
it demonstrates how I implemented class versioning in order to better
manage
class properties deletion and consequences on
existing objects.
This is a private server so it might be slower sometimes ;)
It's a draft based on the trunk so you might discover bugs I don't even
know
about.
This is a proof of concept so be indulgent and follow the demo guide to
see
it work with your own eyes :)
If you are interested in this idea, tell me...
I'm naturally opened to discussion because I may think in the wrong way
or
you may have other ideas...
Anyway, I had fun digging in XWiki code ;)
Don't hesitate to tell me if you discover big problems!
Have fun
regards
Pascal
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Ludovic Dubost
Blog:
http://blog.ludovic.org/
XWiki:
http://www.xwiki.com
Skype: ldubost GTalk: ldubost
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs