OtherPapers.com - Other Term Papers and Free Essays
Search

Use of Encapsulation, Inheritance, and Aggregation in Object-Oriented Methods

Essay by   •  August 11, 2012  •  Essay  •  381 Words (2 Pages)  •  1,435 Views

Essay Preview: Use of 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

...

...

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