Object Oriented Programming--- Computer Programming Learning

Object Oriented Programming

Definition

Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which may contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods.


Basics of OOP

I'm going to give you some insight into the four principles of Object Oriented Programming:
·         Encapsulation: Encapsulation means that the internal representation of an object is generally hidden from view outside of the object's definition. ...
·         Abstraction. ...
·         Inheritance. ...
·         Polymorphism.

I will explain these basics in my next article

Object Oriented Programming (OOP) forces exacting rules on programmers.
Essentially an extension of the modularity concept, OOP goes further by defining each module (called an object) with definite rules for interfacing and a protected set of variables.
For example, if a program object were built to handle the time of day, it might hold data, including the seconds, minutes, and hours. Perhaps it also would have an a.m/p.m. flag and the function that control the setting of the time would not allow illegal values. Thus if someone were to try to set the clock using an hour values of 29, the program would not allow it.
          The protected variables are one of the key advancement in programming, as they allow a programmer to prevent data  from being altered during program execution. A programmer working with a team sets up rules for the legal use of an object’s data, thereby reducing the chances for error when someone unfamiliar with the code tries to use it.
          This technology is a great help with team development projects because programmers can use the objects without needing to learn how they work. Simply understanding an object’s interface enables programmers to use i.

Comments