Object-Oriented Programming

Jun 28th, 2009 | By administrator | Category: Visual Basic

To understand the world of object-oriented programming, look at the world aroundyou for a moment. You might see vacuum cleaners, coffee makers, ceiling fans, and ahost of other objects. Everywhere you look, objects surround you.Some of these objects, such as cameras, operate independently. Some, such as tele-phones and answering machines, interact with one another. Some objects containdata that persists between uses, like the address book in a cell phone. Some objectscontain other objects, like an icemaker inside of the freezer.

Many objects are similar in function but different in purpose. Bathtubs and kitchensinks, for example, both provide water and are used for cleaning. But it is a rare occa-sion when you will take a bath in the kitchen sink or wash your dishes in the tub.However, the bathtub and the kitchen sink in your house probably share the sameplumbing. Certainly, they share a common interface: hot and cold water knobs, afaucet, and a drain.

When you think about it, what is the difference between a sink and a bathtub? Thelocation? The size of the basin? Their heights off the ground? How many more simi-larities are there than differences?Sometimes the same action causes an object to do different things depending on thecontext of the situation. When you press Play on the remote, the DVD might play amovie on the television. But if a CD is in the player, it plays music out of the speak-ers. Same button, same action—different results. When you flip the switch on theback porch, the light comes on. But the switch in the kitchen turns on the garbagedisposal. You use the same kind of switch, but obtain different results.

Source : oreilly.com

Download Ebook

Related Ebook :

One comment
Leave a comment »

  1. I just stopped by your blog and thought I would say hello. I like your site design. Looking forward to reading more down the road.

Leave Comment