11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 11Examining Object-OrientedProgrammingIn This Chapter Making nachos Reviewing object-oriented programming Introducing abstraction and classification Discovering why object-oriented programming is importantWhat, exactly, is object-oriented programming? Object-oriented programming,or OOP as those in the know prefer to call it, relies on twoprinciples you learned before you ever got out of Pampers: abstraction andclassification. To explain, let me tell you a little story.Abstracting Microwave OvensSometimes when my son and I are watching football (which only happenswhen my wife can’t find the switcher), I whip up a terribly unhealthy batch ofnachos. I dump some chips on a plate, throw on some beans, cheese, and lotsof jalapeños, and nuke the whole mess in the microwave oven for five minutes.To use my microwave, I open the door, throw the stuff in, and punch a fewbuttons. After a few minutes, the nachos are done. (I try not to stand in frontof the microwave while it’s working lest my eyes start glowing in the dark.)Now think for a minute about all the things I don’t do to use my microwave: I don’t rewire or change anything inside the microwave to get it to work.The microwave has an interface — the front panel with all the buttonsand the little time display — that lets me do everything I need. I don’t have to reprogram the software used to drive the little processorinside my microwave, even if I cooked a different dish the last time I usedthe microwave.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!