Hey, Uncle Bob is back at OOP,! For me this is very special because it was him who brought me to object oriented design/programming and to my first OOP conference, ever. And this was back in 1992 when I was a enthusiastic software developer, coding in C. Java did not exist in those days, design patterns were not published, there was no TDD – well, it was just the old days of poorly maintainable code!
Bob, when I came into your workshop about object oriented design at OOP, you started with a very simple example in C++ (at least, I thought it was): a car with an engine. You said something like this:
Bob: “OK, guys, lets define an accelerate() method on the car – what would be inside the body of this method?”. And my head started thinking. Somebody else: “The car should tell the carburator to increase the fuel to air ratio. And it should also tell the automatic transmission to shift one gear up!”
Bob: “OK, so Car::accelerate() calls Carburator::increaseFuelToAirRatio(), followed by Transmission::shiftUp(). Question to all of you: Is this a good design or a bad design?”
And poor me, inexperienced in OOD, could say neither yes nor no: “In fact, I don’t know!”.
Bob, you suddenly shouted “Of course, it is a BAD design, very bad design!”
Me: “Oh, why this?”
Bob: “What if you have a Diesel engine, without carburator? And: What if your car has an electric engine, without transmission?”
Me: “Hmmm… well, I guess, I would have to change the design significantly. Something like Thyristor::increaseElectricCurrent().”
Bob: “Exactly! So, how about introducing a neutral abstraction above all this? How about Engine::increasePower()? And with an intelligent Engine class that knows how to increase the power purely by itself? With nobody telling it how to do that?”
Me: “Aha!”
And so 1992 was the year when I became enthusiastic about object oriented design. Thanks a lot, Bob – I am really looking forward to see you again at this OOP. I guess, you won’t remember me but this is not a problem. ![]()
Diese Beiträge könnten Sie noch interessieren:
- Get the trucks off your Kanban board!
- OOP 2012 – Call for Papers
- Why can customers change their requirements so often?
- Preparing for openArchitecture 2005
- Freundlich sein zu Suchmaschinen
Berater, Coach und Trainer für effektive Produktentwicklung
After reading the story again, I just realized that in 1992, we would have written engine::increase_power() instead of Engine::increasePower(), of course! You see how language transforms your memory?