Link Details

Link 90014 thumbnail
User 1 avatar

By rick
via hamletdarcy.blogspot.com
Published: Jun 25 2008 / 03:58

I'll try not to bore you then. Let's get right to it... Does your project have a StringUtils class?
  • 20
  • 5
  • 1473
  • 626

Comments

Add your comment
User 272422 avatar

htowninsomniac replied ago:

0 votes Vote down Vote up Reply

I love the Socratic method the article is written in! Good job.

Of course, one always needs to find a balance. I could almost argue that one should never have utility classes, because static methods are evil. Just the same, singletons are evil because they also cannot really be extended very easily. Everything should be generated in a factory. But for many utilities, that is overkill.

I thank the author for the idea of throwing an exception in the private constructor. While I don't think I create an instance of a utility class not meant to be instantiated from within the utility class itself, I may be mistaken. I'm a human, after all, and therefore I make mistakes.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.