commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <p...@steitz.com>
Subject Re: [PATCH] [collections] CompositeSet and CompositeMap
Date Sat, 29 Nov 2003 18:25:28 GMT
Brian McCallister wrote:
> Attached are CompositeSet and CompositeMap implementations, along with  
> unit tests and a required change to CompositeCollection to properly  
> support CompositeSet.
> 
> The coarse-grained mutator made for a bit of ugliness in the  
> CompositeSet implementation, but it works. I am not wholly satisfied so  
> will probably hack at it some more to try to make the mutator  
> implementation neater.
> 
> Please note that CompositeMap depends on CompositeSet which depends on  
> CompositeCollection (including the changed version here).
> 


Brian,

Couple of comments:

Housekeeping:

* I don't think that the diffs against CompositeCollection made it.
   I at least just got the new classes.  It's probably best to
   open a Bugzilla ticket and attach the new files plus patches there.

* Please try to follow the [collections] style for braces.

Substantive:

Why does CompositeSet extend CompositeCollection? I haven't seen the 
changes to CompositeCollection; but the setup looks a bit strained to me 
(e.g. the type checking in the addComposited method).

Looking carefully at what addComposited does in CompositeSet, I am not 
sure that I understand what CompositeSet and CompositeMap are trying to 
do.  I understood CompositeCollection to be a convenient way to decorate a 
  collection of Collections to provide a unified view.  Once you try to 
control "collisions", as in the Set and Map impls, you seem to be headed 
for some kind of partition concept.  Is that what you had in mind?  Also, 
since add() and resolveCollisions() are separate methods in the mutator 
interface, one could presumably do inconsistent things -- i.e., allow 
"duplicates" to be added directly via add() but disallow them in 
addComposited() by having resolveCollisions prevent duplicates.

Can you explain a little more what the use cases for these things are?

Phil


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message