Object Oriented concepts used in Software
Engineering
Object: - An object is something which is capable of being seen, touched or sensed. Each object has certain distinctions or attributes which enable you to recognize and classify it. Each object has certain actions or methods associated with it.
Class:
-
A class encapsulates data and procedural abstractions required to describe the
content and behavior of some real world entity. A class is a generalized
description that describes a collection of similar objects.
Encapsulation:
- An
object is said to be encapsulate (hide) data and program. This means that the
user cannot see the inside of the object but can use the object by calling the
program part of the object. This hiding of details of one object from another
object, which uses it, is known as encapsulation.
Inheritance:
-
Inheritance is defined as the property of objects by which instances of a class
can have access to data and programs contained in a previously defined class,
without those definitions being restated. Classes are linked together in a
hierarchy. They form a tree, whose root is the class of “objects”. Each class
(except for the root class) will have a super class (a class above it in the
hierarchy) and possibly subclasses. A class can inherit (i.e. acquire) methods
from its super class and in turn can pass methods on to its subclasses. A
subclass must have all the properties of the parent class and other properties
as well.
Polymorphism:
-
Polymorphism includes the ability to use the same message to objects of
different classes and have them behave differently. Thus we could define the
message “+” for both the addition of numbers and the concatenation (joining) of
characters. Polymorphism provides the ability to use the same word to invoke
different methods, according to similarity of meaning.
Object/class
associations: - Objects/classes interact with each other.
Multiplicity defines how many instances of one object/class can be associated
with one instance of another object/class.
Messages:
-
The interaction or communication between the different objects and classes is
done by passing messages. The object, which requires communicating with another
object, will send a request message to the latter. A message can be sent
between two objects only if they have an association between them.
No comments:
Post a Comment