Jump to: navigation, search

ObjectProposal

Revision as of 18:17, 6 May 2013 by Dan Smith (talk | contribs) (Created page with "== tl;dr == A proposal for rich objects that behave the same whether they're able to access the database directly or required to go over RPC. Bundling data with the methods t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

tl;dr

A proposal for rich objects that behave the same whether they're able to access the database directly or required to go over RPC. Bundling data with the methods that operate on them, specifically serialization and the actual database implementation. Create and query operations should be class methods that replace the functional interface(s) in db/api.py. Changes to attributes are tracked so that a save() implementation can perform updates.

Justification

Right now in Nova, everything is converted to a "primitive" before being passed over RPC. We have a large (and nasty) serialization function that aims to be able to serialize any of our objects, and is a constant source of frustration. Passing around primitives means that we use non-OO interfaces to make changes to those items.

The primitives we use are direct representations of the SQLAlchemy objects that we pull out of the database API. This is far from the ideal format, and currently the format of the primitives change if the underlying database schema changes (which is a problem for live upgrade).