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] Naming conventions
Date Fri, 14 Jun 2002 00:10:09 GMT
On Thu, 13 Jun 2002, Jack, Paul wrote:
> I'm even okay with the wrapper classes being package-protected
> OUTER classes defined in the same source file.  Having 
> package-protected classes still gives us a lot of leeway with
> organizing things, as technically users shouldn't be using 
> package-protected methods and classes.

we could even make them public classes and allow users to extend them on 
their own (using the XXXUtils.whatever methods as convenience methods)

> > After a little thought, I think I favour adding Utils to all 
> > of the above.
> > Results in no clashes with Java, and just involves adding methods to
> > ListUtils, CollectionUtils and MapUtils.
> 
> One other consideration is that ListUtils is deprecated.  We 
> could always un-deprecate it, of course.  I'd want to manually
> deprecate each method currently in the class though, but that
> doesn't seem like a big deal.

nope...  not a big deal.  Since you said it though, why would you still
want to deprecate each method?  It seems like "summing" two lists and
returning a List might still be beneficial rather than using a
collection method that returns a Collection.  A user shouldn't assume
that the returned collection from CollectionUtils is really a List (even
if it is at the moment).  Maybe Rodney (if he's even listening and
remembers) can provide some insight as to why he deprecated it a year
ago.

> But otherwise, I think having:
> 
>    BagUtils
>    CollectionUtils
>    ComparatorUtils
>    IteratorUtils
>    ListUtils
>    MapUtils
>    PredicateUtils
>    SetUtils
>    TransformerUtils
>    TreeUtils
> 
> is all good.  I'd like FactoryUtils to be SimpleObjectFactoryUtils,
> which is a very long name but more consistent with the others.

FactoryUtils could still be used.  Then, if later we add another type of 
factory (I have *no* idea what though), we can keep all the factory 
methods in FactoryUtils.  

And actually, we could rename SimpleObjectFactory to just plain Factory.  
I tried looking back at the discussion to understand why it wasn't.  
Here's a review.  

Originally, "Factory" was proposed and had some support:
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-dev@jakarta.apache.org&msgNo=7348

Then, Stephen brought up an interesting point about how different people 
define a factory in different ways (e.g. by having the factory method 
take a parameter), but this still used the "Factory" name:
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-dev@jakarta.apache.org&msgNo=7366

It wasn't until Aaron Bates, the person that proposed the Lazy 
collections in the first place, put his code up on the web:
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-dev@jakarta.apache.org&msgId=338897

And, of course, "She/He who does the work, wins"

But that doesn't mean we can't do more work and rename it.  I didn't
really see any arguments against naming it "Factory" rather than
"SimpleObjectFactory"

> > On method names, I agree with your implicit use of   yyyedXxx, eg.
> > filteredMap or predicatedSet
> 
> This is all sounding dangerously close to consensus!  I think this
> is probably the only civilized conversation on naming conventions
> I've ever had... :)

:)

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