commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: [lang] StringUtils isEmpty summary(2)
Date Sun, 20 Jul 2003 17:15:25 GMT
> -----Original Message-----
> From: Laird J. Nelson [] 
> > -----Original Message-----
> > From: Laird J. Nelson []
> > How about either:
> > * StringUtils becomes an instance class that is configured at
> > construction time:
> As counter as this is at the moment to the whole Jakarta *Utils
> philosophy (as it is currently burned into code--static, stateless
> utility classes), and as much as I disliked this idea even as I was
> suggesting it, the more I think about it the more I think this (or a
> singleton-based approach) is the right way to go.  Many projects will
> have, say, two different libraries, both of which will need to use
> StringUtils in the same VM, so static configuration options probably
> aren't (an option, that is).

Not only two different libraries, but I could easily have code in the
same project (even method) that would use a NPE-throwing StringUtils and
a NPE-swallowing StringUtils.  So static configuration would be really
bad here.

Moving to a Singleton + Static Delegator (static methods delegated to an
internal singleton reference) could be a nice way to go.  It'd allow me
to add new string utilities via subclassing of the singleton (assuming
it's a configurable singleton).


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

View raw message