[Dev] Re: [UIDev] Item Collection inclusion/exclusion

Don Dwiggins d.l.dwiggins at computer.org
Fri Jul 2 09:35:33 PDT 2004


> First, some background.  Item collections are initially 
> populated by a rule, but later items can be added to/deleted 
> from that collection by calling include()/exclude().  The item 
> collection maintains three lists (results, inclusions, 
> exclusions). 

> Question 1:
 
> If an item already exists in an item collection because it meets 
> the rule, and then you call include() passing that item, should 
> the item exist in the list twice?  Some possibilities are not 
> changing the collection at all when this action is taken, adding 
> it to the inclusions list but only reporting the item once when 
> asked for all of its members, or reporting the item twice.  From 
> a users standpoint you probably only want to report it once (is 
> there a case where this isn't true?) and performance would be 
> best if you take no action if the item is already included. 
> However, with that scenario some information is lost (the fact 
> that the item was manually included) which may or may not be 
> important. 

First, can the rule be changed?  If so, are the previously 
existing inclusions and exclusions to be maintained, or should 
they be dropped?

Also, whether an item should appear on the results list twice 
depends on whether you want the semantics of a set or a bag.

As to performance, I'd leave that consideration aside until you 
get the intended semantics (the contract) clarified.  There may 
turn out to be multiple implementations possible, with different 
performance tradeoffs. 

 
> Question 2: 

> How should the exclusion list operate?  If you have an item that 
> is in an item collection solely because it was manually 
> included, can you just remove it from the inclusion list or do 
> you have to track it on an exclusion list.  If you just remove 
> it from the inclusion list then it might show up at some later 
> point if it begins to meet the rule.  If you keep it on an 
> exclusion list, then that exlusion list can grow to an 
> unmanageable size.  In general, there is a distinct possibility 
> that our exclusion lists could grow quickly if we aren't careful 
> (think removing spam). 

Do you want to keep a history of the collection, allowing for 
something like rollback?  If not, the last operation should "win". 
Including an excluded item, or vice versa, should move it from one 
list to the other.  I'm assuming here that the intended semantics 
is that the inclusion and exclusion lists act as "manual 
overrides" to the rule, so they need to be kept around.  Hmmm, it 
seems like you may want to add "remove {in,ex}clusion" operations.


HTH,
Don Dwiggins



More information about the Dev mailing list