r2 - 25 May 2006 - 11:21:20 - PhilippeBossutYou are here: OSAF >  Journal Web  >  OSAFCommunity > EventsAndMeetings > CoreSprintWeekSpring2006 > CollectionMeeting20060512

Everything you wanted to know about Collection and were afraid to ask - Alecf

Philippe's notes

This is a simple dump of the notes I took at that meeting. Not being a hard core coder myself, I may have picked a very simplified view of the problem so do not consider this as a definite guide on collections but rather a beginner's introduction.

What is a Collection

  • A Collection is an item in the repository backed by the notion of Sets
  • Member __collection__= 'set': name of the attribute backing the collection
  • Schema: set = schema.Many()
  • A Refcollection is a list of items, a RefCollection though is not a Collection
  • A Set is a wrapper (a tuple really) around a Refcollection that makes it usable by the set algebra. Sets are not items
  • Set Algebra: sets can be combined to create other sets (Union, etc...), those can be then wrapped in collection
  • A set is then an algebraic tree (operation tree), the leaves of the tree are RefCollection or KindQueries, the nodes are sets (and then not items) or collections (which are items).
  • Each Collection maintain the list of sources that are collections (i.e. the elements of the tree that are collections instead of sets)
  • Sets are better thought of as operations than results. This is required because sets must be reevaluated dynamically (each time an element in the tree changes).

Notification

  • This is the tricky part (and most of the cause of the complexity)
  • Everything is dynamic in Chandler so when a collection is changed somewhere, lots of things need to be notified: all the collections using it and eventually the UI

SmartCollection

  • This is the collection type to use in the Chandler's sidebar
  • A SmartCollection is either:
    • a list of items
    • a wrapper around an existing collection
  • User defined collections are all SmartCollection
  • It is always trash aware
  • Simplifies the algebra construction
  • They are easy to create from a given collection (just pass it as a parameter in the construction)
  • They handle the inclusions and exclusions (items added/suppressed by the user)
  • SmartCollections are used to populate the "Appears in"
  • To avoid overlays (union of SmartCollection used internally when selecting several collections in the sidebar) to appear also in the "Appears in", we use AppCollection that are the same as SmartCollection but one level down, just so that they don't appear in "Appears In".

Mine/not mine

  • Can be viewed as the first implementation of Mimi's notion of Spheres
  • Mine is a UnionCollection and has sources (other collections designated as mine). Mine is not a SmartCollection.
  • The All collection is the SmartCollection that wraps Mine

Set Algebra problem (wrt to Mine especially)

  • Because the SmartCollection all contain Trash in their evaluation tree, the notification fires for lots of collections in any given tree
  • Doing brute force propagation has big perf implications
  • The solution (for 0.7alpha3) is to write an algorithm that will simplify the expression tree (Andi)

Overlays

  • Overlay collections created internally when the user selects or activates several collections in the sidebar
  • Issue with the fact that SmartCollections are trash aware but the trash is accessible in the sidebar...
  • A bunch of workarounds have been implemented recently for 0.7alpha2 but this needs to be fixed in 0.7alpha3
  • The expression tree simplification should help here

Larger Issue

  • Indexed Collections: not addressed in this meeting (other than ranting about it that is...)

-- PhilippeBossut - 25 May 2006

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.