Encapsulation, Inheritance and Polymorphism
There are three major features in object-oriented programming: encapsulation, inheritance and polymorphism.
Encapsulation Enforces Modularity
Encapsulation refers to the creation of self-contained modules that bind processing functions to the data. These user-defined data types are called "classes," and one instance of a class is an "object." For example, in a payroll system, a class could be Manager, and Pat and Jan could be two instances (two objects) of the Manager class. Encapsulation ensures good code modularity, which keeps routines separate and less prone to conflict with each other.
Inheritance Passes "Knowledge" Down
Classes are created in hierarchies, and inheritance allows the structure and methods in one class to be passed down the hierarchy. That means less programming is required when adding functions to complex systems. If a step is added at the bottom of a hierarchy, then only the processing and data associated with that unique step needs to be added. Everything else about that step is inherited. The ability to reuse existing objects is considered a major advantage of object technology.
Polymorphism Takes any Shape
Object-oriented programming allows procedures about objects to be created whose exact type is not known until runtime. For example, a screen cursor may change its shape from an arrow to a line depending on the program mode. The routine to move the cursor on screen in response to mouse movement would be written for "cursor," and polymorphism allows that cursor to take on whatever shape is required at runtime. It also allows new shapes to be easily integrated.
OOP Languages
Used for simulating system behavior in the late 1960s, SIMULA was the first object-oriented language. In the 1970s, Xerox's Smalltalk was the first object-oriented programming language and was used to create the graphical user interface (GUI). Today, C++ and Java are the major OOP languages, while C#, Visual Basic.NET, Python and JavaScript are also popular. ACTOR and Eiffel were earlier OOP languages. The following list compares some basic OOP terms with traditional programming. See object technology and object-oriented DBMS.
OOP Traditional Programming
class description of data +
processing
object (instance) actual data + processing
attribute actual data (a field)
method function that processes a
particular structure
message function call
instantiate allocate a structure
Object Modeling
When information systems are modeled as objects, they can employ the powerful inheritance capability. Instead of building a table of employees with department and job information in separate tables, the type of employee is modeled. The employee class contains the data and the processing for all employees. Each subclass (manager, secretary, etc.) contains the data and processing unique to that person's job. Changes can be made globally or individually by modifying the class in question.
![]() | Reproduced with permission from Computer Desktop Encyclopedia. Copyright (c) 1981-2008 The Computer Language Company Inc. All rights reserved. |
Additional Resources
- iPhone vs. Android development: Day 3
- This is the 3rd in a series of 5 posts about an iPhone programming course I'm taking this week. The course is presented by Big Nerd Ranch. To make things more interesting I'm writing about how iPhone development differs from Android development, a subject with which I'm more familiar. ...
- Blog posts 2008-11-19
- iPhone vs. Android development: Day 2
- Welcome to day 2 of a 5-day course on iPhone programming presented by Big Nerd Ranch. During the course I'll be blogging about the differences between Android and iPhone development. [Read: Day 1, Day 3, Day 4, Day 5] Yesterday we learned about creating...
- Blog posts 2008-11-18
- Setting a vision and stepping back
- Brendan Eich, CTO of Mozilla, explains how he controls a company full of open source code—by setting a vision and stepping back. He lets people decide for themselves how to fine tune their programming. Even without tight control, the company has made progress in tabbed browsing, privacy, and performance. by...
- Blog posts 2008-11-18
- CRM 2.0 = The Conversation - But First....The Intro
- This is my first post for ZDNET. I'm back from a 10 day cruise to the Caribbean - had a great time - came back to the economy worse than what I left - though gas prices are great - and I'm feeling relaxed anyway - so I thought it...
- Blog posts 2008-11-18
- Is there anything teachers or students need that Google Apps can't do?
- I'm giving serious thought to switching our school to Google Apps from our current ISP's email system this coming summer. Only teachers and staff have access to district email right now; the switch would provide students, teachers, and staff with school email accounts and access to the suite of...
- Blog posts 2008-11-18
- iPhone vs. Android development: Day 1
- As I mentioned last week I've started learning more about developing for the Apple iPhone. This week I'll be sharing my experiences during a 5-day course on iPhone programming presented by Big Nerd Ranch. In particular, I'll be pointing out differences between Android and iPhone development. [Read:...
- Blog posts 2008-11-17
- SaaS competition in PPM and GRC heats up
- More SaaS movement from a major software vendor CA yesterday announced the availability of two software as a service SaaS solutions. One is targeted for the IT management space while the other is oriented around governance. CA is taking its on-premise enterprise...
- Blog posts 2008-11-17
- Making Man As Super As His Computer
- Worst case, Steve Wallach figures it costs $10,000 to buy a blade server that can execute 50 billion floating point operations in a second. By that measure, it would take $200,000 to buy 20 of the blades, to handle a trillion operations a second in a heavy-duty scientific or financial...
- Blog posts 2008-11-17
- Oh Mamma.com: SEC charges Mark Cuban with insider trading; Cuban responds
- Updated: The Securities and Exchange Commission said Monday that it has charged Mark Cuban with insider trading for selling 600,000 shares of Mamma.com. Specifically, the SEC says that search engine Mamma.com, known today as Copernic, invited Cuban--owner of the Dallas Mavericks and former Yahoo and Broadcast.com exec--to...
- Blog posts 2008-11-17
- OLPC is dead...What Kindlenomics taught us
- Fellow ZDNet blogger, Jason Perlow, wrote a neat piece suggesting that, if electronic versions of most college textbooks existed, it wouldn't take many semesters for the average undergraduate to pay for the Kindle on which to read them. In fact, with a fair amount of arm-waving, it wasn't too...
- Blog posts 2008-11-16
- BearingPoint's Q3 earnings call - part 1
- To BE or not BE Several news groups and Wall Street firms covered BearingPoint's BE Q3 results this week but one point was not well covered, if at all. Look at this bullet point that is at the bottom of a list of points BE...
- Blog posts 2008-11-14
- Whatever happened to the 'middle' in middleware?
- Quote of the week: "In the mid 1990s, 'middle' meant 'the gaps between applications and software components.' Middleware was technology you turned to in order to try to build distributed systems: transaction processing middleware, database middleware, object middleware... Middleware was a technological concept. ...Now, 'middle' means...
- Blog posts 2008-11-14
- My superintendent wants a blog
- It's actually a great idea - I wish I'd thought of it first. It came about as we were looking for a way to easily solicit public input on our strategic planning documents (a blog is an obvious choice, with each piece of the document posted separately), but it...
- Blog posts 2008-11-14
- Is Sonatype a harbinger of the future?
- Maven uses a Project Object Model concept an XML construct to handle software management for large Java installations. It offers integration with NetBeans and Eclipse. by Dana Blankenhorn
- Blog posts 2008-11-14
- Getting started with iPhone development
- I've been doing Android development for some time, and before that I experimented with Palm and Blackberry, so I figured it was time for some hands-on iPhone programming as well. In this article I'd like to share a few of my initial experiences. Apple released the first...
- Blog posts 2008-11-13
- Review: Why Android is for me and the G1 isn't
- For me, when it comes to cell phones, it's a marriage of convenience. I value the basic function of a cell phone to connect me to the rest of the world from almost anywhere, but beyond that, I couldn't care less about the "features." Despite my power...
- Blog posts 2008-11-12
- SOA In Any Economic Climate
- Keep ahead of change with service oriented architecture SOA. With SOA, businesses can flexibly adjust strategies and practices while lowering costs by repurposing existing software rather than replacing it. Other savings are possible as well, making SOA a sound investment. This white paper from ZapThink discusses how organizations can quickly...
- White papers 2008-11-12
- Making sense of SOA and today's IT innovations
- New business technology initiatives are constantly popping up. But how do they relate to one another, and to your business? This white paper summarizes some of the more important initiatives in play today, and the service-oriented philosophy that can help you tailor your technology to best serve the people that...
- White papers 2008-11-12
- IBM® Smart SOA™ approach for smarter business outcomes
- As your business model changes — and these days, change is the only constant — you need the flexibility to adapt effectively. Enter service oriented architecture SOA, a business-driven IT approach that helps you see change coming and use it to your advantage. This brochure is a starting point to...
- White papers 2008-11-12
- Windows 7 - The "Blue Badge" experience
- Windows 7 - The "Blue Badge" experienceProbably didn't want to distract testers...Microsoft probably didn't want to distract testers from focusing on more important items, so they left these trivial eye-candy features hidden.RE: Windows 7 - The"(for 32-bit Vista … no 64-bit version available yet)"Nice slip there ;)Underwhelmed...These features are profoundly...
- Discussion threads 2008-11-10
Neighboring Terms
Premier Vendor Content Whitepapers, webcasts & resources from our Power Center Sponsors
- Video: Intel Manufacturing Methods: Unit Level Traceability Auto Strap
-
This video provides an overview of Intel's Unit Level Traceability (ULT) system, a technology developed to address the complexities that exist with the introduction of new manufacturing technologies in Assembly/Test in Intel. Video playing time is 4 minutes.

- Observe this system in action on the Intel assembly line >>







