Monday, August 10, 2009

Coding with Coad

Whatever happened to Peter Coad? He and Mark Mayfield wrote, in my opinion, the book on Java-based Object Oriented Design in 1996 (2nd edition appearing in '98), and it ain't for Javaphiles alone. Their criteria for making the choice between using inheritance or composition in a given situation is alone more than worth the price of admission. It's something that more developers should read and apply: in short, use inheritance only when:
  • Your object "Is a special kind of" the candidate parent object and not “Is a role played by” that object
  • You will never need to transmute your object to be in some other class
  • Your object extends rather than overrides or nullifies behavior
  • Your object does not subclass what is merely a utility class
  • For problem domain objects, your object is "a special kind of " role, transaction, or thing
Now, Coed and Mayfield go on to explain under what circumstances you would reasonably break these rules but that such circumstances are indeed exceptions.

To answer my opening inquiry as to the whereabouts of Mr. Coad, it seems that once his company TogetherSoft was acquired by Borland (I truly miss TogetherJ ControlCenter), he sort of drifted out of the software development game. He's a pretty religious guy, they say, and he's focused on that arena of his life. He and I don't share that particular passion, but I'm sure whatever he's doing there, he's doing it well. It looks, from his website, that he's also started up a charter jet service, along with launching several biblical software applications. Modeling in Color, Feature Driven Development, Party, Place or Thing: all I know for sure is that the software development profession is the poorer with his absence.

No comments:

Post a Comment