Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object Oriented Analysis and Object Oriented Programming Session 5 LBSC 790 / INFM 718B Building the Human-Computer Interface.

Similar presentations


Presentation on theme: "Object Oriented Analysis and Object Oriented Programming Session 5 LBSC 790 / INFM 718B Building the Human-Computer Interface."— Presentation transcript:

1 Object Oriented Analysis and Object Oriented Programming Session 5 LBSC 790 / INFM 718B Building the Human-Computer Interface

2 Agenda Collaboration and sequence diagrams Getting from diagrams to Java code Making sense of the API What’s in a GUI?

3 Flight Finder Exercise http://www.glue.umd.edu/~oard/spacea/ff/

4 FlightFinder Use Case Diagram JOSAC Traveler Select Search Parse Sched >

5 Search Use Case Narrative Assumptions –Current JOSAC schedule parsed Pre-conditions –None Initiation –Search function selected Dialog –Search parameters selected, search initiated, unknown locations resolved, route list displayed Termination –Route search complete (normal), unknown location (error) Post-conditions –Route list displayed (if available) or blank

6 Select Use Case Narrative Assumptions –Route list displayed Pre-conditions –At least one available route Initiation –Route selected from list Dialog –Select route, display details in map+timeline+text Termination –Display completed Post-conditions –Details displayed

7 Flies betweenContains Simple Class Diagram Route GUI Map Timeline Location Airfield Leg AircraftType Schedule Flight * 1 1 * 2 1..911..** * 0..1 1 1 1 1 * Sequence of Displayed in 2 1 Travel between Uses

8 Flies between * 0..1 1 1 Full Class Diagram Route GUI Map Timeline Location Airfield Leg AircraftType Schedule Flight 1 * 1..911..** Sequence of 2 1 Travel between +addLeg(l:Leg) +summary():String +search(p:Param) +display(r:Route) +draw(r:Route) -seats: integer -departureTime: Time -arrivalTime:Time +parse(s:String) +summary():String -name:String -icaoIdentifier:String{4} -latitude:double -longitude:double -timeZone:TimeZone +distanceTo(l:Location) -flightNumber:String +parse(s:String) -updated:Time -source:URL +parse(f:File) -name:String -speed:int +flightTime(o:Location, d:Location) Contains Uses Displayed in 1 1 Displayed in 1 * 2 *

9 D Object Diagram 1:Route :GUI :Map :Timeline DC:Location Andrews:Airfield :Leg C-9B:AircraftType Sep26:Schedule AF302:Flight -seats=3 -departureTime=1200Z -arrivalTime:1400Z -name=Andrews AFB -icaoIdentifier=KADW -latitude:38-48N -longitude:076-51W -timeZone=EASTERN -flightNumber:AF302 -updated:Sep 26/1200Z -source:http://www… -name=C-9B -speed=450 knots LA:Location -latitude=33-57N -longitude=118-24W -timeZone=PACIFIC Scott:Airfield -name=Scott AFB -icaoIdentifier=KBLV Lambert:Airfield :Leg -seats=34 -departureTime=1600Z -arrivalTime=1900Z -name=Lambert Field -icaoIdentifier=KSTL LAX:Airfield -name=LA Intl Airport -icaoIdentifier=KBLV NV514:Flight -flightNumber:NV514 O D O O D 1st 2nd Key: O = Origin D = Destination

10 Collaboration Diagram 1:Route :GUI :Map :Timeline DC:Location Andrews:Airfield second:Leg C-9B:AircraftType Sep26:Schedule AF302:Flight LA:Location Scott:Airfield Lambert:Airfield first:Leg LAX:Airfield NV514:Flight 1:getText() 7:getText() 2:getText() 5:getText()6:getText() 3:getText() 4:getText() 10:getText()11:getText() 8:getText() 9:getText() 13:getLatLong() 12:getLatLong() 15:plot(r:Route) 14:plot(r:Route) Scenario: First route selected

11 Sequence Diagram :GUIall:Airfieldsnear:Airfieldsandrews:Airfieldfirst:Leg findNear(dept):Airfields return near nextAirfield():Airfield return andrews nextLeg():Leg return first getDestination():Airfield return scott return near findNear(scott):Airfields Continue depth-first search, pruning unsuccessful routes after 9 legs

12 Practice Exercise Create a Class Diagram for an academic transcript –Include a method to add courses –Include a method to compute grade point average –Include a method to print the transcript Code (only) the transcript class in java –Include a main method that tests the class –Create stubs for any other needed classes Run your main method

13 Working with the Java API Instantiate an object: –String s = new String(“test”); –int i = s.indexOf(“s”); Directly use a static method: –int z = Math.min(x,42); Use a static method to get an object: –NumberFormatter f = NumberFormat.getCurrencyInstance(); –String d = f.format(327);

14 Classes to Explore in the API String –Manipulate strings (e.g., to extract substrings) StringTokenizer –Pick apart strings (e.g., into words) GregorianCalendar –Dates and times Hashtable –Like arrays, but with any object as the index

15 Muddiest Point On a blank sheet of paper, write a single sentence that will convey to me what you found to be the most confusing thing that was discussed during today’s class.


Download ppt "Object Oriented Analysis and Object Oriented Programming Session 5 LBSC 790 / INFM 718B Building the Human-Computer Interface."

Similar presentations


Ads by Google