Chapter 1. Object-Oriented Programming: What's It All About?
In This Chapter
Reviewing the basics of object-oriented programming
Getting a handle on abstraction and classification
Understanding why object-oriented programming is important
This chapter answers the two-pronged musical question: "What are the concepts behind object-oriented programming, and how do they differ from the procedural concepts covered in Book I?"
Object-Oriented Concept #1: Abstraction
Sometimes, when my son and I are watching football, I whip up a terribly unhealthy batch of nachos. I dump chips on a plate, throw on some beans and cheese and lots of jalapeños, and nuke the whole mess in the microwave oven for a few minutes.
To use my microwave, I open the door, throw in the plate of food, and punch a few buttons on the front. After a few minutes, the nachos are done. (I try not to stand in front of 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 in order 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 buttons and the little time display — that lets me do everything I need.
Reprogram the software used to drive the little processor inside the microwave, even if I cooked a different dish the last time I used the microwave.
Look inside the microwave's case.
Even if I were a microwave designer and knew all about the inner workings of ...
Get C# 2010 All-in-One For Dummies® now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.