Unify inventory (serialization)
behas opened this issue · 0 comments
behas commented
Just to make sure we don't forget about this :-)
Here is how I see a unified conceptual "model" for inventory handling:
- resources are generated from "objects" (files, mem, db) the "live" behind the "source" and "client" interface
- the source and the client expose an "inventory", which they populate with their resources. So the inventory is essentially a set of resources
- A SiteMap is a possible serialization of an "inventory" -> an inventory should provide functions for reading and writing resources to SiteMaps; this can be extended with other inventory formats later on.
- The "inventory" should contain all the functionality for comparing two sets of resources (source / client) and finding updates, deletions, etc...
In Ruby I would probably implement the "the inventory" as mixin (http://rubysource.com/ruby-mixins-2/).
In python we could, for instance, implement "inventory" and specializations thereof as pyhton objects and mix them into the source and the client:
Inventory(object):
def add_resources(...)
def to_sitemap(...)
def from_sitemap(...)
def find_updates(self, other_inventory)
def find_deletes(self, other_inventory)
....
Source(object, Inventory)
....
Client(object, Inventory)
....
Thoughts, comments are appreciated.....