-
Website
http://andypalmer.com -
Original page
http://andypalmer.com/2008/05/static-utility-methods/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Andy Palmer
2 comments · 1 points
-
Rob Myers
1 comment · 1 points
-
tswicegood
1 comment · 1 points
-
-
Popular Threads
Your post did leads me to wonder: what if static methods could be "extended" how might that work. I certainly haven't thought through that extensively. I'm sure the java language people have, and there must be great reasons why its not possible.
Maybe look at it this way: using "composition," you can make whatever instantiable utility classes to wrap any existing other classes/methods you find are otherwise unsatisfactory.
"abc1234".reverse();
than:
StringUtils.reverse("abc1234");
I think if I bumped into one of the instances I mentioned where I wanted to be able to change out the configuration at runtime, then I would use an instance wrapper around a static method...
My opinions are no way set in stone, it's just that static methods make me feel icky and I'm not 100% sure why :-)