Friday, December 11, 2015

Concepts Of OOP:



   >>> In OOPS, we try to model real - world objects. But, What are real - world objects? Most real - world objects have internal parts and interfaces that enable us to operate them. These interface perfectly manipulate the internal parts of the objects. They also have the exclusive rights to do so.

             >>> Let us understand this concept with the help of example. Take the case of a simple LCD projector (a real world object). It has a fan lamp. however, the operation of these switches is necessarily governed by rules. If the lamp is switched on, the fan should automatically switch itself on. Otherwise, the LCD projector will get damaged. For the same reason, the lamp should automatically get switched off if the fan is switched off. In order to cater to these conditions, the switches are suitable linked with each other. The interface to the LCD projector is perfect. Further, this interface has the exclusive rights to operate the lamp and fan.

   >>> This, in fact, is a common characteristic of all real - world objects. if a perfect interface is required to work on an object, it will also have exclusive rights to do so.

No comments:

Post a Comment