OtherPapers.com - Other Term Papers and Free Essays

Encapsulation, Inheritance, and Aggregation in Object Oriented Methods

Essay by   •  August 11, 2012  •  Essay  •  369 Words (2 Pages)  •  1,482 Views

Essay Preview: Encapsulation, Inheritance, and Aggregation in Object Oriented Methods

Report this essay
Page 1 of 2

There are three terms in software development that are frequently used. They are

encapsulation, inheritance, and aggregation; each plays a powerful role in any successful

software project. They are used in programs to interact and tell objects what to do. All the

interaction methods allow for complete control and flexibility.

Encapsulation is the process in which no direct access is granted, instead it is hidden

(4MicrosoftSolutions, 2011). The object that is responsible for the data is the only object that can

grant access to it, and the only way to do it is through direct interaction. For example, if you

wanted to make any changes to an employee's file, such as updating or even just viewing, then

you would have to interact with employee object.

Inheritance is the reuse of code by one class being able to inherit the attributes and

methods of another class. It is the concept that when a class of objects is defined, any subclass

that is defined can inherit the definitions of one or more general classes (Rouse, 2005). A good

example would be the military. You have a private class that has common properties (name,

rank, etc.) for all privates and commanding officers, such as a sergeant. Commanding officer

class has to inherit this private class to define standard properties and it may have its own

properties also like number of privates under him. So, whenever there is a change for private

class, it will reflect on the commanding officer class also.

Aggregation is when an object consists of a composite of other objects that work

together. This is a very powerful feature to have in OOP for accurately modeling and

implementing business processes in the programs. Here is a good example to describe how

aggregation interacts with objects. An automobile object is a composite of the engine object,

steering wheel object, etc. In fact, the steering wheel object and the engine object are a

composite of many other objects.

In conclusion, if encapsulation, inheritance, and aggregation are used correctly in

software development, then they should serve as



Download as:   txt (2.2 Kb)   pdf (48.9 Kb)   docx (9.4 Kb)  
Continue for 1 more page »
Only available on OtherPapers.com
Citation Generator

(2012, 08). Encapsulation, Inheritance, and Aggregation in Object Oriented Methods. OtherPapers.com. Retrieved 08, 2012, from https://www.otherpapers.com/essay/Encapsulation-Inheritance-and-Aggregation-in-Object-Oriented/32358.html

"Encapsulation, Inheritance, and Aggregation in Object Oriented Methods" OtherPapers.com. 08 2012. 2012. 08 2012 <https://www.otherpapers.com/essay/Encapsulation-Inheritance-and-Aggregation-in-Object-Oriented/32358.html>.

"Encapsulation, Inheritance, and Aggregation in Object Oriented Methods." OtherPapers.com. OtherPapers.com, 08 2012. Web. 08 2012. <https://www.otherpapers.com/essay/Encapsulation-Inheritance-and-Aggregation-in-Object-Oriented/32358.html>.

"Encapsulation, Inheritance, and Aggregation in Object Oriented Methods." OtherPapers.com. 08, 2012. Accessed 08, 2012. https://www.otherpapers.com/essay/Encapsulation-Inheritance-and-Aggregation-in-Object-Oriented/32358.html.