Ticket #1137 (assigned enhancement)

Opened 3 years ago

Last modified 23 months ago

Remove need for statefulness in vdm

Reported by: rgrp Owned by: kindly
Priority: major Milestone:
Component: vdm Keywords:
Cc: Repository: vdm
Theme: none


Statefulness, especially statefulness for relation (esp m2m) is cause of most of the complexity in vdm. It is required because, atm, revision objects have FKs to continuity objects.

This ticket proposes the following changes:

NB: this could be limited just to case of join tables (leaving state stuff on other tables)

  • Remove FKs from revision to continuity (or allow for them to be nullable).
    • We could just limit this to m2m stuff
  • Delete of an object leads to:
    • Deletion of continuity object
    • Adding an entry in revision table with state set to deleted (we retain state on revision table)

If this is done we will no longer need to worry about filtering on state on relationships as join table will only contain "active" relationships.

If we do this on all tables we remove need for any state awareness in client (e.g. no need to filter tables on active state).

The only disadvantage of this change is that undeletion becomes more problematic (we have to recreate some continuity objects).

Change History

comment:1 Changed 3 years ago by rgrp

Most of this change has been implemented in the changeset branch [1] but could be backported reasonably easily to main.

[1]: https://bitbucket.org/okfn/vdm/src/changeset/

comment:2 Changed 3 years ago by kindly

I am not sure this needs to be done. I think we should keep the continuity object always in the table, even if it is deleted. The querying should be done through the logic layer so the deleted state should not be an issue.

The clients should be entirely state aware.

The only thing that needs to be done is to remove all statefullness of relations. These are the only things that are complicated.

This would make vdm just a simple copy on write mechanism, with the client controlling the state.

comment:3 Changed 23 months ago by icmurray

  • Owner changed from rgrp to kindly
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.