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-2009 The Computer Language Company Inc. All rights reserved. |
Additional Resources
- Software that automatically fixes itself, without shutting down
- Invariant DetectionThis is supposing that the software is simple enough to determine invariants and not block valid code paths that are infrequently used. It sounds a lot like applying design by contract after the fact.Software That Fixes Itself?The headline implies an application that fixes itself. The article describes and...
- Discussion threads 2009-10-29
- ActivePresenter 2.0 (Windows)
- ActivePresenter is a screen capture and presentation creation tool designed for simple screencasting, eTraining and eLearning. With blazing fast smart screen capture technology and a powerful authoring environment, ActivePresenter includes all the tools needed to record a presentation and easily convert the output to video (AVI, WMV, MPEG4/MP4, Flash), HTML,...
- Software downloads 2009-10-21
- Indigo 4.1.1 (Mac)
- Indigo is a home control server that integrates INSTEON and X10 hardware devices. Save money, conserve water, and reduce electrical usage by automating your home with Indigo's unlimited scheduling and control logic. Using Indigo's built-in Web server, you can access and control your home from anywhere using any modern Web...
- Software downloads 2009-10-10
- Radaee Reader 1.1 (Windows)
- Radaee PDF Reader OCX is a series of viewer components. Includes ViewerDoc COM Object, Viewer Conrol, Miniature Control, and Outline View Control. developers can build a customer interface for viewing PDF documents. it support Visual Basic, VC, Delphi, C#, HTML Internet Explorer or any other programming languages or tools been...
- Software downloads 2009-10-05
- SimpleIPCExpress 1.0.0.2 (Windows)
- SimpleIPCExpress lets you have some of your application's work performed in an external process on the same machine - insulating your app from memory leaks and process crashes. You make function calls to objects in the external process as if they were local objects. Under the covers you're using .NET...
- Software downloads 2009-09-25
- Quest 4.1 (Windows)
- Quest lets you create sophisticated text-based games, without having to program. Make text adventures, role-playing games, training materials, simulations, or interactive fiction. With its easy-to-use visual editor, absolutely no programming is required--everything about your game is displayed in plain English. A full tutorial is included so you can get started...
- Software downloads 2009-08-03
- Avoid accidental complexity, and 96 other things every software architect should know
- Favor simplicity. Avoid accidental complexity. Don't worry about building the 'perfect' beast. Don't worry about future-proofing. Treat people with respect. These common-sense pearls of wisdom come from a book titled 97 Things Every Software Architect Should Know, edited by Richard Monson-Haefel, that is packed with truisms...
- Blog posts 2009-07-20
- Illusion 4 (Mobile)
- Illusion is an optical illusion program for the Palm OS PDA. It hasstunning graphics and comes in two versions, Illusion 3 for themonochrome PDA and Illusion 4 for the colour PDA.Illusion is for those of you who want to show your friends the graphical capabilities ofyour PDA, to show your...
- Software downloads 2009-07-08
- Compiler 911 0.2009.4.1 (Windows)
- Optimizing, easy and clever, multi-target object pascal and assembler compiler, suitable absolutely for all kinds of programming tasks on x86 platform even writing an own OS. Contains the set of source code analysis and refactoring tools. Has an easy and friendly user interface. Version 0.2009.4.1 introduces the first semantic source...
- Software downloads 2009-06-29
- Radaee Reader 1.0.8 (Windows)
- Radaee PDF Reader OCX is a series of viewer components. Includes ViewerDoc COM Object, Viewer Conrol, Miniature Control, and Outline View Control. developers can build a customer interface for viewing PDF documents. it support Visual Basic, VC, Delphi, C#, HTML Internet Explorer or any other programming languages or tools been...
- Software downloads 2009-06-20
- WebDNA Developer Edition 6.2 (Mac)
- WebDNA allows the developer to build a wide range of applications, from basic form-to-email to highly sophisticated database-driven intranet sites. While it is not a framework like Ruby on Rails, WebDNA replaces multiple instructions with a single one, allowing the developer to code as much as 3 times faster than...
- Software downloads 2009-05-26
- WebDNA Developer Edition 6.2 (Windows)
- WebDNA allows the developer to build a wide range of applications, from basic form-to-email to highly sophisticated database-driven intranet sites. While it is not a framework like Ruby on Rails, WebDNA replaces multiple instructions with a single one, allowing the developer to code as much as 3 times faster than...
- Software downloads 2009-05-25
- MSDN Webcast: Office Project Client Programmability (Level 300)
- The presenter of this webcast shows how to develop against the Microsoft Office Project client object model. The presenter looks at using Microsoft .NET and Microsoft Visual Studio Tools for the Microsoft Office System VSTO for programming to supplement standard Microsoft Visual Basic for Applications VBA, and examines connecting to...
- Webcasts 2009-04-23
- Code Visual to Flowchart 6.0.0420 (Windows)
- Code Visual to Flowchart is an automatic flow chart generator software. It can reverse engineering a program, create programming flowchart from code, mostly used on flowcharting a program and documenting source code. It can generate Bmp, PNG, Visio, Word, Excel and PowerPoint flowcharts document, help programmers to document, visualize and...
- Software downloads 2009-04-15
- Resumes in a Web 2.0 world
- Resumes in a Web 2.0 worldRE: Resumes in a Web 2.0 worldYeah so great idea to have your Resume include the "social networking" component...2 things I see wrong here: 1: Most companies put a block on all social networking/blog websites. (yes most IT Admi'sn can un-block them, but why?) 2:...
- Discussion threads 2009-04-07
- The SAS Hash Object in Action
- In SAS Version 9.1, the hash table - the very first object introduced via the DATA Step Component Interface in Version 9.0 - has finally become robust and syntactically stable. The philosophy and application style of the hash objects is quite different from any other structure ever used in the...
- White papers 2009-02-27
- Automate Dummy Variable Creating From Large Longitudinal RDBMS Tables - A Pedagogical Example of the SAS/Connect Piping Facility
- Given a list of patient demographic characteristics and the patient lab records in RDBMS tables separated by years, one can create a list of summary variables per specification per person almost automatically using 3 parallel processes: process #1 selects all lab records only for the patients in the ID list...
- White papers 2009-02-27
- GeoDataSource .NET Control 1.0 (Windows)
- The GeoDataSource .NET Control works with Microsoft Access, SQL Server and mySQL to query the complete GeoDataSource World Cities Database (Basic, Premium and Gold Edition). You can use the software object to query database by city and also calculate the distance between two cities or two latitude and longitude sets....
- Software downloads 2009-02-01
- What is American?
- What is American?hear hearI agree wholeheartedly, JohnCompletely agree! Great post.I completely agree with your post, John. I hate it when people try to impose what being an American means. Being American means being someone who is willing to learn and word hard to achieve his dreams, not someone who thinks...
- Discussion threads 2009-01-30
- CORBA 2.3 - POA and OBV
- What better could have spoiled the party for CORBA than portability concerns? The first drive was to standardize the client interface of CORBA. This was a success. However, the server side was underspecified and resulted in incompatible server side implementations. Portability needs to be addressed in the next specification. This...
- White papers 2009-01-01
Neighboring Terms
Premier Vendor Content Whitepapers, webcasts & resources from our Power Center Sponsors
SmartPlanet
- Thought-provoking progressive ideas on diverse topics that intersect with technology, business, and life, and matter to the world at large. Visit SmartPlanet
- More from IBM
- How to Drive Better Business Outcomes with Exceptional Web Experiences Download the eBook
- Driving Business Agility through SOA Connectivity & Integration Read the White Paper from IBM
- Linking Decisions and Information for Organizational Performance Read the Tom Davenport study



