commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Smith" <...@apache.org>
Subject Re: [Collections] adding sync/unmod
Date Sat, 17 Aug 2002 22:59:29 GMT
Stephen Colebourne wrote:
> From: "Stephen Colebourne" <scolebourne@btopenworld.com>
>>From: "Jack, Paul" <pjack@sfaf.org>
>>>>- add factory methods for unmodifiable, synchronized
>>>>Collections
>>>>(suggest they forward to Collections)
>>>
>>>Well, I guess we could add these because they're so easy to write,
>>>but because they're so easy to write, I wouldn't want to add them.
>>>We'd just be duplicating the JDK's API, and importing
>>>java.util.Collections isn't terribly inconvenient.
>>
>>I agree that it is duplication. But the grounds is ease of use. Currently
>>we say that if the collection is a Bag, or a Buffer then the user must use
>>BagUtils or BufferUtils, but otherwise use Collections. This is needlessly
>>complicated.
> 
> Paul, have you thought any more on this? Michael/any one else any views?
> 
> I really would like to add synchronized and unmodifiable pass through
> methods to CollectionUtils, ListUtils and MapUtils.

I'm not a big fan of pass through methods.  I think it unnecessarily 
clutters the API, which I think has more of a negative effect on overall 
ease of use than it would to eliminate the need for a different import 
statement and class name.

On the other hand, I would be in favor of adding class documentation 
that references the relevant methods from java.util.Collections, just in 
case someone doesn't know they exist and looks at our Utils class to 
provide that functionality.  That should eliminate any question a user 
may have on "where to look" for a particular decorator.

regards,
michael


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


Mime
View raw message