













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














► Information is stored within the object ► It is hidden from the outside world ► It can only be manipulated by the objectitself
► A phone stores several phone numbers ► We can’t read the numbers directly from theSIM card ► Rather phone-set reads this information forus
► Simplifies the model by hidingimplementation details ► It is a barrier against change propagation
► Ali stores his personal information andknows how to translate it to the desiredlanguage ► We don’t know How the data is stored How Ali translates this information
► A Phone stores phone numbers in digitalformat and knows how to convert it intohuman-readable characters ► We don’t know How the data is stored How it is converted to human-readablecharacters
► An object encapsulates data and behaviour ► So how objects interact with each other? ► Each object provides an interface(operations) ► Other objects communicate through thisinterface
► Steer Wheels ► Accelerate ► Change Gear ► Apply Brakes ► Turn Lights On/Off
► Provides services offered by the objectinterface ► This includes Data structures to hold object state Functionality that provides required services
► Data Structure Mechanical structure of gear box ► Functionality Mechanism to change gear
► Means change in implementation does noteffect object interface ► This is achieved via principles of informationhiding and encapsulation
► A driver can drive a car independent ofengine type (petrol, diesel) ► Because interface does not change with theimplementation
► Users need not to worry about a changeuntil the interface is same ► Low Complexity ► Direct access to information structure of anobject can produce errors
► Objects communicate through messages ► They send messages (stimuli) by invokingappropriate operations on the target object ► The number and kind of messages that canbe sent to an object depends upon itsinterface