commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack, Paul" <>
Subject RE: [reflect][collection] Predicate - a question
Date Mon, 17 Jun 2002 19:07:14 GMT
> I understand that :-) I was asking why (do you use static 
> factory methods for decorating things)? Are there reasons for 
> it you considered that makes it better than ordinary 
> constructors? Like: \"the value of hiding the implementing 
> classes in static factory methods is considered higher than 
> the awkwardness of having to expand the util class any time a 
> usable decorator shows up.\"

To me the chief considerations are:

1.  Organizing things into static utility classes makes the 
public API easier to absorb and navigate.
2.  Using static utility classes is usually more convenient,
in that you need to import fewer classes.
3.  It's usually unnecessary and in some cases impossible to
subclass a composition class; typically you have to create 
another wrapper class and chain them.


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

View raw message