Monday, February 17, 2014

Object Oriented Programming Concepts

Object Oriented Programming Concepts


Object :-
             
What is Object ?
  • Simply, An Object is an entity which has a well defined structure and behaviour.
  • An object possesses certain characteristics as:
  1. State
  2. Behavior
  3. Identity
  4. Responsibility
--> Everything in this world is an object, from a nail to hammer, from a bus to Air-plane. From human perspective, an object is a tangible or visible thing or something that exists in time and space.

Object Can be defined as:
"An object represents an individual, Identifiable item, unit or entity, either real or abstract, with a well-defined role in the problem domain i.e., object has Identity, state, Behavior, and Responsibility."
Example: A car, a person, etc are different objects.

1.State of an Object :-

  • The State of an Object includes the current values of all its attributes.
  • An Attribute can be static or dynamic
For example, Employee Attributes
                       1.empID 
                       2.name
                       3.gender
above three attributes are Static Attributes.
                       4.age
                       5.address
                       6.phone
                       7.basicsal
                       8.education
                       9.experience
remaining these and all are Dynamic Attributes of an Employee .

2. Behavior of an Object :-
  • Behavior is how an object acts and reacts, in terms of its state changes and message passing.
  • Behavior of an object corresponds to its functions. The change in state of an Object reflects in its behavior.

For example, "calculate salary" and ''Print Details " are the behaviors of the employee. There can be other behaviors too. They can either help to retrieve the information or change the state of the attributes.

3. Identity of an Object :-

  • Identity is that property of an object which distinguishes it from all other objects.
  • A single or a group of attributes can be identify of an object.
  • Every object existing in this world can be distinguished from the other. In other words, every object has its own identity.
4. Responsibility of an Object :-
  • Responsibility of an object is the role it serves within the system. 


Some Important Points to remember about OBJECT

  • Every Object has a state, behavior, responsibility, and unique identity.
  • A system comprises of multiple objects existing together in a meaningful interaction.
  • This meaningful interaction in the given system decides the responsibility of that object in that system.
  • The Responsibility of an object decides the behavior of that object.
  • The behavior of an object is governed by the change in state of that object.
  • For changing the state of particular object, it is essential to identify it separately from all the other objects.


    This is about OBJECT in C# -- Object Oriented Programming Concepts

                                                                         --- Seed Infotech Ltd, Bangalore



No comments:

Post a Comment