1 Object Oriented Analysis And Design Object Oriented Analysis And Design Overview Overview
CIS 554 2 What is an Object?•A self-contained package, with specific variables (attributes) and methods (behaviors).•An object stands alone.•An object’s implementation is purposely hidden from us.
3 What is an Object?
CIS 554 4 What is an Object?
CIS 554 5 What is a Class?
CIS 554 6 What is a Class?
7 What is a Message?
CIS 554 8 Example Object • Description - provides time of day, and an audible indication of a user-defined timeduring the day • Interface – Inputs - timeof day, alarm time – Outputs - timeof day, audiblealarm • Attributes – hour hand, minutehand, second hand, bell • Behaviors – Increment hour, increment minute, increment second, sound bell
CIS 554 9 Key Object-Oriented Characteristics • Encapsulation (Information Hiding) – Attributes and behavior arerolled into theobject, and hidden from therest of us. Only thing exposed is the“public interface” • Inheritance – Creating oneobject from another, already defined object, adding to its capabilities and public interface.. • Polymorphism – Specific object behavior is determined within a run-timecontext. An object can “morph” itself based on thecontext in which it is currently used. • Re-useable – With very discreteand finitecapabilities, objects can beused in other parts of the system, or within other systems.
CIS 554 10 Clock Object • How does our clock rate as an object? – Encapsulation • Provides hour, minutes and seconds, and an alarm. • Do weknow themechanisms for incrementing hours, minutes and seconds? Sounding the alarm? – Inheritance • Wecan useour simpleclock object to createadditional, morecomplex objects requiring time. E.g., chronograph, washing machinetimer controller, etc. – Polymorphism • Not applicable – Re-usable • Our clock can beused in thousands of applications as is. Wecan useit in any application that requires us to keep track of time, and alert us when a certain timehas occurred.
CIS 554 11
You've reached the end of your free preview.
Want to read all 42 pages?
- Spring '08
- thesyste, Obje, Obje ple ct, nt pe nt, pe nt ode