Object Oriented System
Chapter
1
Object Oriented System When we examine computer based solution (program), found the following elements in a program. Data Algorithm Algorithm describes how to change a data or it outlines the various steps required to transform a data. In this context, we could say algorithm shape the data. Each algorithm is designed in such a way so that it can transform the data. Functional and data aspect of a system When we examine a system, we can find it is composed of several sub-systems. Each sub-system is responsible to perform specific task.
A
Syste
B
Fig-1
A SubSystem
SubSystem
B
SubSystem
Fig-2
Figure-1 shows the system in its entirety, where as figure-2 shows how the system was actually constructed. If we view each bubble of fig-2 as a task or process; it is the
1
Object Oriented System functional aspect of the system. So it is clear each function is entrusted with particular data that is the data aspects of the system since data is being changed by the function. Object aspect of a system The following are standard functions a CD drive provides Opening shutter Closing shutter Eject CD Reading and writing data Flash LED while operates The very sight of CD-Drive enables us to remember all those operations. Each of the above listed operations is bound with some data. For example LED flash while CD performs some activity and stop blinking when ceases its operations. So, we can assume that there will be a data that store state of LED based on various activities Fig-3.
Open/Clo se shutter
LED-
Read/Wri te
Eject-CD
Fig-3
While using CD-drive we are not aware of various internal operations and its hardware and software implementation complexities, instead we just press few buttons to get operation done, because we think it is a device or OBJECT. As you know all objects has properties and behavior. Here CD-Drive shows its behavior through functions like open, close, read, write, flash LED etc. The CD-drive hides implementation complexities using its metallic covering, and user is exposed with few buttons to interact with the device, devising a computer based software solution in this way is known as object oriented programming.
2
Object Oriented System Object oriented programming lets you to think in a new way about the problem as well as solution. Object Object is a thing or entity having unique identity. Object may be conceptual or concrete. Object has properties and methods Objects can communicate with each other Objects can be grouped into class Class can have ancestral class or classes Object Oriented Programming Features Abstraction Inheritance
Encapsulation. Polymorphism
Abstraction “Consider only necessary and required features of an object under study. Thus an object having many details may not be considered all those details for your study if it is not relevant for your system.” Encapsulation Packaging all your findings as properties and methods of the objects, so you can classify them. Inheritance If already you have a class, you can create another class with similar features and some extra added features by using the existing class. Polymorphism A method of class behaves differently in two objects of the same class.
3