BASIC CONCEPTS OF OBJECT-ORIENTED PROGRAMMING
😀
It is necessary to understand some of the concepts used extensively in object-oriented programming . These include
- Objects
- Classes
- Data abstraction and encapsulation
- Inheritance
- Polymorphism
- Dynamic binding
- Message Passing
1.OBJECTS👀
Objects are the basic run-time entities in an object-oriented system. They may represent a person .Place , a bank account ,a table of data or any item that the program has to handle. They may also represent user-defined data such as vector ,time and lists. Programming problem is analyzed in terms of objects and the nature of communication between them. Program objects should be chosen such that they match closely with the real- world objects. Objects take up space in the memory and have an associated address like record in Pascal ,or a structure in C.
When a program is executed , the objects interact by sending messages to one another . For Example ,if "|Customer" and "Account" are two objects in a program, then the customer object may send a message to the account object requesting for the bank balance. Each object contains data, and code to manipulate the data. Objects can interact without having to know details each other's data or code. It is sufficient to know the type of message accepted , and the type of response returned by the objects.
- Object occupy some space in memory.
- Object is an instance of a class. Because...
- Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behaviors - wagging, barking, eating.
- An object is an dynamic entity that has limited lifespan .Object are created and eventually destroyed ,Also during their lifetime, the attributes of the object may undergo significant change.
Comments
Post a Comment