transition Silva UI to use versions the right way

Reported by Martijn Faassen on 2003-07-21
Affects Status Importance Assigned to Milestone

Bug Description

We need to carefully investigate whether we can move forward with transitioning
Silva towards a better use of versions.

A sketch of the idea:

   * non-versioned content objects have just one version, itself

   * versioned content objects have multiple versions

   * public view displays one version, Silva UI may
     display other versions

   * VersionedContent objects should really have as
     few methods as possible, and no metadata.
     Everything should be on the version.

   * Right now we have a hack for title and short title, where
     we have get_title(), get_title_editable(), and the same
     for short_title. In case of VersionedContent, this forwards in a
     rather complicated way to the previewable version in case of
     get_title_editable() and to the viewable version in case of get_title().
     A similar case will evolve for modification date and last author,
     both now versioned.

   * This is wrong, as we don't want all these methods to exist on the
     VersionedContent. They need to be on the version. (one problem is of
     course that VersionedContent right now subclasses from SilvaObject;
     I suspect this is also going to be wrong, we need to refactor this).

   * We can change the Silva UI so it runs through the *versions* and gets
     the titles and other metadata from that, instead of from the
     VersionedContent objects.

We need to start taking steps in this direction for 0.9.3. I don't expect we
can finish the job, but let's see how far we can get for say, tab_contents
for containers. We need a few new methods on containers to support this,
which return the version (viewable or previewable) instead of the
versionedcontent objects.

Martijn Faassen (faassen) wrote :

Oh, a few more hints about the inheritance refactoring (this is not the
first phase, but I hope this will make things clearer):

Right now, we have this:

    / \
Content VersionedContent

and VersionedContent contains Version.

We need to go to this (perhaps):

    SilvaObject Version
    | | /
 VersionedC Content

and VersionedContent contains Version.

Another alternative, perhaps more attractive, is:

    SilvaObject VersionBase
     | \ / \
   VersionedC Content SingleVersion Version

and VersionedContent and Content *both* contain VersionBase. Content
just only ever contains *one* version (a SingleVersion), as it is not actually
versioned. Perhaps 'version' is the wrong word, but renaming version to
'content' would be rather complicated at this stage. :)

The more I think about it the more the last model seems to be the most

In all models SilvaObject loses a lot of responsibilities which go onto
Version. It's just that in the second 'hybrid' model Content also has some
of the Version responsibility, while in the last (I think superior) model
both VersionedContent and Content are mostly clear of any responsibilities,
and Version has most of it.

Christian Zagrodnick (zagy) wrote :

I'm not sure if i understood the second approach. is a sketch containing Document and
SimpleContent to clearify what I did understand.

Is that the way it is thought to be?

Martijn Faassen (faassen) wrote :

Yes, I looked at the sketch and that is indeed what I meant.
Thanks for the diagram, that is very useful!

Christian Zagrodnick (zagy) wrote :

i think this will not happin in 0.9.3, pushing to 0.9.4

Martijn Faassen (faassen) wrote :

Agreed, 0.9.4 or later.

Kit Blake (kitblake) on 2007-04-14
Changed in silva:
importance: Low → Wishlist
Changed in silva:
assignee: zagy → nobody
Sylvain Viollon (thefunny) wrote :

We won't break the world for this.

Changed in silva:
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers