commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Smith" <>
Subject Re: [Collections] adding sync/unmod
Date Sat, 17 Aug 2002 22:59:29 GMT
Stephen Colebourne wrote:
> From: "Stephen Colebourne" <>
>>From: "Jack, Paul" <>
>>>>- add factory methods for unmodifiable, synchronized
>>>>(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
> 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.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message