DOC PREVIEW
AUBURN COMP 7700 - Object Orientation

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1COMP 7700 – Object-Orientation1Chapter 2Object OrientationCOMP 7700 – Object-Orientation2Process Phase Affected by This ChapterRequirementsAnalysisDesignImplementationArchitectureFramework Detailed DesignKey: = less soAdapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.COMP 7700 – Object-Orientation3Before Object OrientationReal world conceptsSoftware DesignEntitiesSkljkvjkvjfkavjafkksaovjsdvjfvkfjvkfjkSkljkvjkvjfkavjafkksaovjsdvjfvkfjvkfjkSkljkvjkvjfkavjafkksaovjsdvjfvkfjvkfjkSkljkvjkvjfkavjafkksaovjsdvjfvkfjvkfjkAdapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.COMP 7700 – Object-Orientation4How Do We Express Ourselves?"Customers Montague andSusan entered the Ajax bankand were served by tellerAndy ..... "AJAX BANKAdapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.2COMP 7700 – Object-Orientation5How We Express Ourselves"CustomersMontague and Susanentered the Ajaxbank and wereserved by tellerAndy ..... "CLASSESOBJECTSNote that Java code convention reverses this capitalization.Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.COMP 7700 – Object-Orientation6Object OrientationReal world conceptsSoftware design entitiesSkljkvjkvjfkavjafkksaovjsdvjfvkfjvkfjkSkljkvjkvjfkavjafkksaovjsdvjfvkfjvkfjkSkljkvjkvjfkavjafkksaovjsdvjfvkfjvkfjkSkljkvjkvjfkavjafkksaovjsdvjfvkfjvkfjkAccountgetDetails()Transactionexecute()CustomergetFirstName()Direct correspondenceGraphics reproduced with permission from Corel.Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.COMP 7700 – Object-Orientation7Key Concept:  Benefits of OO Object orientation provides adirect mapping betweenconcepts and code.Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.COMP 7700 – Object-Orientation8Class IntroductionAjaxCustomerReal world Classin Design(UML notation)Classin Source code(Java)class AjaxCustomer{ . . . . }PermissionToPayclass PermissionToPay{ . . . . }MentalconceptAdapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.3COMP 7700 – Object-Orientation9aliceBrownBMW:Auto …The Members of a ClassAutopublic int vehicleID …protected int mileage …private myPrivateVariable …static int numAutosMade …Class modelToyotanumAutosMade12390924850984mileage33024jaynesCar:Auto …mileage83402Objects of AutoSubclasseshave thesememberstoomyToyota:Toyota …mileage2105…Static variable:One version onlyNon-static variable: Oneversion for every objectAdapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.COMP 7700 – Object-Orientation10Attribute Types (Shlaer & Mellor)• Naming:– fixed for each object– distinguishes individuals• Descriptive:– varies through life of object• Referential:– ties instance of one class toinstance(s) of another– == aggregationAuto vehicleIDmileageownerAdapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.COMP 7700 – Object-Orientation11Key Concept: Classes and Objects A class expresses a concept suchas “HondaCivic.”An object is an instance of a classsuch as “the Honda Civic withvehicle ID 89R783HJD894.”COMP 7700 – Object-Orientation12The Clients of a Classclass Customer{ . . . String getName() { … } int computeBalance() { … }. . .}class AjaxWebsiteGenerator{ . . . void makeProfile( Customer c ) { … String name = c.getName() … } . . .}class AjaxAssets{ . . . int computeAssets() { . . . Customer c = customers[ i ]; assets += c.computeBalance(); . . . }. . .}Client of CustomerClient of CustomerClass CustomerAdapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.4COMP 7700 – Object-Orientation13Aspects of OO Useful for ApplicationDevelopment Class Introduction (section 2.2.1)– basic motive of Object Orientation– identifying parts that corresponds to the real world Instantiation (section 2.2.2)– creating instances of encapsulated concepts Inheritance (section 2.3.1)– capturing the way concepts occur in hierarchy Polymorphism (section 2.3.2)– capturing use of single action word to represent differentthings, depending on contextAdapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.COMP 7700 – Object-Orientation14Requirements For e-Mail Creation Example1. Summary:Produces e-mail text for various types of customers.2. Detailed requirements2.1 The application displays choices to the console, asshown in figure xx.2.2 For customers delinquent more than 90 days, the e-mail message generated is the statement shown infigure xx.Page 1 of 4Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.COMP 7700 – Object-Orientation15Typical Interaction for e-mail Creation ExamplePage 2 of 4Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.COMP 7700 – Object-Orientation162.3 All non-delinquent customers receive a tailored e-mailmessages as follows. 2.3.1 Mountain customers:This month we have a special on West Face tents.Only $700.... lots more output specialized to mountaineeringcustomers ... 2.3.2 Regular customers:All items are marked down 20% for this month only.... lots more output for regular customers ...Requirements For e-Mail CreationExamplePage 3 of 4Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.5COMP 7700 – Object-Orientation17Requirements For e-Mail Creation Example2.4 The e-mail is to be displayed on the console.3. Future enhancementsWe anticipate that the text is likely to changefrequently, and that new kinds of customers arelikely to be specified, each with its own new set ofrequirements.Page 4 of 4Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.COMP 7700 – Object-Orientation18Disadvantages of Branching• Code for each case not


View Full Document

AUBURN COMP 7700 - Object Orientation

Download Object Orientation
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Object Orientation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Object Orientation 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?