BYTE.com > Mr. Computer Language Person > 2005
Refactoring
By Martin Heller
June 20, 2005
(Refactoring
: Page 1 of 1 )
Some of you may wonder if you're reading the wrong Martin this month. Yes, it is me, your curmudgeonly Mr. Computer Language Person. On the other hand, refactoring is one of Martin Fowler's pet subjects and the subject of one of his books, Refactoring: Improving the Design of Existing Code (with Kent Beck, John Brant, William Opdyke, and Don Roberts, Addison-Wesley, 1999; ISBN 0201485672). Fowler is a slightly more theoretical guy than I am—he describes himself as an author, speaker, and consultant on the design of enterprise software.
As a programmer and consultant, I'm a relatively pragmatic, hands-on guy, not a design guru. For years, when I taught Windows programming at the Boston University Corporate Education Center (the former Wang Institute), I refused to teach object-oriented design. Why? I thought the curriculum was too theoretical for the level of students I saw go through the program. I thought they needed to get their hands dirty building real code before they got all airy-fairy drawing diagrams and playing "find the objects."
I've since changed my mind, at least partially. Almost all programmers, and certainly all Java, C#, and Visual Basic .NET programmers, need to understand enough object-oriented design to understand why class libraries and frameworks, which are the new API delivery mechanisms of choice, are structured the way they are. Almost all programmers need to know how to use inheritance and aggregation to incorporate the functionality of a pre-written class into their own classes. Almost all programmers need to be able to understand UML diagrams. Almost all programmers need to be able to override a method and implement an interface. Not all programmers need to know how to design classes, but almost all programmers need to know how to consume classes.
Refactoring
Once you grok the major ideas of object oriented design, a whole new world can open up for you. You can move your thinking to a higher level of chunking—it's a little like a chess player learning to think in terms of families of offensive and defensive strategies instead of thinking in terms of how each piece can move.
Page 1 of 1
BYTE.com > Mr. Computer Language Person > 2005
|