Thursday, 7 April 2016

What is Object and its characteristics ?



An object is an entity that has well defined structure and behavior.

Examples of Objects
Air, Hard Disk, Pen, Person, Printer, Color, Point, Bank Account, Contract, Signal, Industrial Process, Medical Investigation, Transaction, Training Course
An object can be a tangible, intangible or a conceptual entity.


Characteristics of an Object

State
The state of an object encompasses the current   values of all its attributes. An attribute can be static (constant) or dynamic
Example: Values of all attributes at any moment defines the state of the car.


Behavior
Behavior is how an object acts or reacts, in terms of its state changes and operations performed upon it.
Example: Totality of operations we can perform upon an Window and consequent changes in attributes defines behavior of an Window.


Identity
Identity is that property of an object which distinguishes it from all other objects.
Example : Account number uniquely identifies an account among all others.


Responsibility
The responsibility of an object is the role it serves within the system.
Example of object responsibilities :
Sensor - Sense temperature and initiate controller action.
Controller - Control current in the heater.
Heater - Raise or lower current.



Example of all characteristics of an Object

(Bank Account Object)
Responsibility: Keeps track of stored money with the facility of deposits and withdrawals.
Attributes: Balance, Interest rate, Account number             
Behavior: Get Balance, Withdraw
State: Balance=10000, Account number=1011, Interest rate=2%
Identity: Account number=1011

Moving from real world entity to a corresponding software object.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.