Jump to: navigation, search

Difference between revisions of "TaskFlow/Persistence/Objects, not Collections"

(Created)
 
(What: Update BP info)
Line 1: Line 1:
 
== What ==
 
== What ==
  
'''blueprint''': TBD
+
'''blueprint''': https://blueprints.launchpad.net/taskflow/+spec/lb-not-collections
  
It is proposed to stop treating logbook object as collection of lesser objects: LogBook and FlowDetails should be made simple data-transfer objects, not containers.
+
It is proposed to stop treating logbook object as collection of smaller objects: LogBook and FlowDetails should be made simple data-transfer objects, not containers for FlowDetails and AtomDetails respectively. Corresponding API should be moved to backends.
  
 
== Why ==
 
== Why ==

Revision as of 08:11, 31 March 2014

What

blueprint: https://blueprints.launchpad.net/taskflow/+spec/lb-not-collections

It is proposed to stop treating logbook object as collection of smaller objects: LogBook and FlowDetails should be made simple data-transfer objects, not containers for FlowDetails and AtomDetails respectively. Corresponding API should be moved to backends.

Why

  • general sanity
  • optimization for certain tasks (monitoring, UI)
    • while perserving good performance for engines
  • better cache semantics
    • backend should know that better

TBD: more descriptive text here.

Implementation Notes

  • remove __iter__ and find from LogBook and FlowDetail
  • add methods to Connection instead:
    • instead of FlowDetail methods:
      • get_atom_by_uuid(uuid) -> atom_detail
      • get_atoms_for_flow(flow_uuid) -> [atom_detail]
      • get_atoms_by_name(flow_uuid, name) -> [atom_detail] [1]
      • save_atom(atom_detail, ...) -> atom_detail [2][3]
    • instead of LogBook methods:
      • get_flow_by_uuid(uuid) -> flow_detail
      • get_flows_for_book(logbook_uuid) -> [flow_detail]
      • save_flow(flow_uuid)

When: 0.3 series

How:

  • add methods to impl_memory.Connection
  • modify storage.Storage, make engine and storage tests run
  • modify other backends one by one
  • modify backends' base class

Notes

  1. backend does not guarantee that names will be unique in the flow, API must reflect that
  2. returns updated atom detail
  3. may need O_CREATE-like option (raise exception when atom already exists)