Monday, August 08, 2005

The PO-STAR Movement

In the past year, I have seen an increasing number of "Plain Old *" abbreviations:
  • POJO - Plain Old Java Objects
  • POCO - Plain Old CLR (.NET runtime) Objects
  • POX - Plain Old XML
At this point, I think it qualifies as a crypto-movement, and the clue to the genesis of this movement is in Andy Smith's "Why Frameworks Suck."
Frameworks hurt sharing. I’d really like to give you this fork Jimmy, but you’re gonna need a knife and plate to use it.
The alternative to PO* is to buy into some framework, which inevitably prevents code reuse as your classes become riddled with framework junk.

You know a library is really a framework when:
  • It requires you to derive your classes from some library class.
  • It requires you to use their main() function.
  • It requires you to use their Application class.
  • It requires your classes to depend on some third party library.
  • The setup() and teardown() methods of your test suites become really complex.
Nearly every time that I have written framework-like functionality into an application, I have found that I was able to factor it out in favor of simple library classes that are themselves PO* objects.