Friday, March 16, 2012

What is oop

What is the definition of OOP:
Object oriented programming is a design approach where we thing in term of object rather than thinking in term of function.
                                                OR
Object-oriented programming is an approach that provides a way of molding
programs by creating partitioned memory area for both data,
and functions that can be used as templates for creating copies of such modules on demand.”
                                                OR
Object-oriented programming is a method of implementation in which programs are organized as cooperative collections of objects, each of which represents an instance of some class, and whose classes are all members of a hierarchy of classes united via inheritance relationships.


By applying oops we try to achieve  the Rules of software engineering. such as
  1. Reusability-------classes and object
  2. Extensibility-----inheritance, aggregation and composition
  3. Simplicity--------abstraction, encapsulation and polymorphism
  4. Maintainability & security---all the above 3 combined helped to maintain the code better

To understand this concept we can take a real world example of Students in a School.
    1. Lets take “Students” as a Class.
    2. Class can have any number of Objects. Here
       “Biology Students” & “Computer Students”.
    3. “Students” are controlled by “Teachers” which acts as an Interface.
    4. “Students” Class can be Re-Used to create
       “Biology Students” and “Computer Students”.

Further reading:
  1. code Project object oriented programming
  2. oops in java

No comments:

Post a Comment