One prime characteristic that is constant in the world of software is the change and advancement in software. That change is one of the most critical aspects of software development. Development of new tools and techniques is common for everyday technology users. For software engineers, the most important thing is the maintainability, portability, reusability, integrity, security, and user-friendliness. So to build today's sophisticated software it is just not enough to put together a sequence of programming statements or procedures. Programmers need to use sound construction techniques and program structures that are easy to figure out implement and modify in a wide variety of situations. It is possible and efficient to use with Object-oriented Programming techniques.
Since the inventions of the computer and programming languages, many approaches have been tried. These includes:
- Modular Programming
- Top-down Programming
- Structured Programming
- Bottom-up programming
Java is purely under the category of Object-oriented Programming.
The primary objective of the object-oriented technique is to
eliminate some flaws encountered in the procedural approach. OOP
handles and treats data as a critical element and never allows
these data to move freely around the system. It binds data more
closely to the functions and protects them from unintentional
alteration by other functions.
OOP allows programmers to break down a problem into the number of entities called Objects and then build data and functions around these entities. The combination of data and methods make up an object.
i.e. Object = data + method
Figure - Object Representation:
In the above figure, a circle is an object, and it comprises of data and methods where methods surround the data.
Major Objectives of Object-Oriented Programming
- The emphasis is on the data rather than the procedures.
- Methods that operate on data are tied together in a data structure.
- Programs are divided into small instance called Objects.
- Data remains hidden and cannot be accessed by external functions.
- Objects may communicate with each other through methods.
- The programs follow the bottom-up approach.
- New data and methods can be easily added whenever necessary.
Basic Terms and Features that are used and provided by OOP
- Classes and Objects
- Data Abstraction
- Data encapsulation
- Dynamic Binding
Advantages of OOP
- Code recycle and reuse.
- Wrapping up of data into a single unit.
- Easy to partition the work in a project based on objects.
- Message passing technique between objects for communication makes interface description with external systems much more straightforward.
- Software Complexity can be easily handled and managed.
- Possible to map objects in a problem domain within a program.
- Data hiding is possible.
- Use of inheritance can eliminate redundant codes in a program.