commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <>
Subject RE: [lang] StringUtils isEmpty summary(2)
Date Sun, 20 Jul 2003 16:27:13 GMT

I would expect it to look like:

StringUtilsInstance  which matchs the current string utils but is a
package private instance.

StringUtils, which is a static class wrapping StringUtilsInstance with.
StringUtilsNPE, which is a static class wrapping StringUtilsInstance with
NPE throwing.


StringUtilsInstance has a constructor which accepts a PreCheckStrategy
object. This would allow things like throwing NPE, modifying the argument
on the way in to make null equal "", throwing IAE, or some such. Then we'd
have StringUtils, StringUtilsNPE etc which would choose their own

Dunno. Seems we can do some sexy facade work here. Just a shame there's no
delegates keyword :)


On Sun, 20 Jul 2003, Laird J. Nelson wrote:

> > -----Original Message-----
> > From: Laird J. Nelson []
> > How about either:
> (First of all, let me also say that I am merely a lurker on this issue
> and am throwing out ideas for the fun of it, not because I want to hold
> up anything, or cause trouble.  :-))
> > * 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).
> Laird
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message