Object Oriented Analysis and Object Oriented Programming - PowerPoint PPT Presentation

About This Presentation
Title:

Object Oriented Analysis and Object Oriented Programming

Description:

and Object Oriented Programming Session 4 LBSC 790 / INFM 718B Building the Human-Computer Interface Agenda Class diagrams Object diagrams Object design Object ... – PowerPoint PPT presentation

Number of Views:42
Avg rating:3.0/5.0
Slides: 20
Provided by: Prefer238
Category:

less

Transcript and Presenter's Notes

Title: Object Oriented Analysis and Object Oriented Programming


1
Object Oriented AnalysisandObject Oriented
Programming
  • Session 4
  • LBSC 790 / INFM 718B
  • Building the Human-Computer Interface

2
Agenda
  • Class diagrams
  • Object diagrams
  • Object design
  • Object oriented programming in Java

3
Object Modeling
  • Models are abstractions of reality
  • That are created for a specific purpose
  • Classes represent types of entities
  • That are important for the chosen purpose
  • Specify subordinate objects and methods
  • Objects are specific instances of classes
  • Encapsulate specific objects and methods

4
Flight Finder Exercise
http//www.glue.umd.edu/oard/spacea/ff/
5
Flight Finder Background
  • The traveler (or a system administrator) will
    first obtain schedule data from JOSAC using their
    Web browser and store it on their hard drive in
    the received format. Upon program initiation,
    the Parse Sched use case will run automatically.
    Once that completes, the traveler may specify the
    origin, destination, radius around each, and a
    connection radius (or leave any of the default
    values set), earliest and latest times, and then
    initiate the search. Once the search completes,
    the traveler may step through the interesting
    routes one at a time, viewing information on
    which their decision might be based. Once one or
    more acceptable routes have been identified, the
    traveler can then contact the appropriate
    facilities directly to make travel arrangements.

6
FlightFinder Use Case Diagram
Search
ltltincludegtgt
JOSAC
Parse Sched
Traveler
ltltincludegtgt
Select
7
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

8
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
    maptimelinetext
  • Termination
  • Display completed
  • Post-conditions
  • Details displayed

9
Flight Finder Background
  • The traveler (or a system administrator) will
    first obtain schedule data from JOSAC using their
    Web browser and store it on their hard drive in
    the received format. Upon program initiation,
    the Parse Sched use case will run automatically.
    Once that completes, the traveler may specify the
    origin, destination, radius around each, and a
    connection radius (or leave any of the default
    values set), earliest and latest times, and then
    initiate the search. Once the search completes,
    the traveler may step through the interesting
    routes one at a time, viewing information on
    which their decision might be based. Once one or
    more acceptable routes have been identified, the
    traveler can then contact the appropriate
    facilities directly to make travel arrangements.

10
FlightFinder Class Diagram
1..9
1
1..

Route
Leg
Flight
Sequence of

Sequence of



Flies between
Contains
Displayed in
1
2
0..1
1
GUI
Airfield
Schedule
1
1
Travel between
Uses
Displayed in
1
1
2
Map
Location
AircraftType
Displayed in
1
Timeline
11
Full FlightFinder Class Diagram
1..9
1
1..

Route
Leg
Flight
Sequence of

Sequence of
addLeg(lLeg) summary()String
-seats integer -departureTime
Time -arrivalTimeTime parse(sString) summary()
String
-flightNumberString parse(sString)


Displayed in

Flies between
Contains
0..1
Uses
GUI
Airfield
Schedule
1
1
search(pParam) display(rRoute)
-nameString -icaoIdentifierString4
-updatedTime -sourceURL parse(fFile)
2
1
1
Travel between
1
Map
Location
AircraftType
Displayed in
2
Displayed in
draw(rRoute)
-latitudedouble -longitudedouble -timeZoneTimeZ
one distanceTo(lLocation)
-nameString -speedint flightTime(oLocation,
dLocation)
1
1
Timeline
draw(rRoute)
12
FlightFinder Object Diagram
1st
1Route
2nd
NV514Flight
Leg

-flightNumberNV514
-seats34 -departureTime1600Z -arrivalTime1900Z
Leg
AF302Flight
LambertAirfield
GUI
-seats3 -departureTime1200Z -arrivalTime1400Z
-flightNumberAF302
-nameLambert Field -icaoIdentifierKSTL

O
AndrewsAirfield
LAXAirfield
Sep26Schedule
-nameAndrews AFB -icaoIdentifierKADW
-nameLA Intl Airport -icaoIdentifierKBLV
D
Map
-updatedSep 26/1200Z -sourcehttp//www
O

DCLocation
ScottAirfield
D
-latitude38-48N -longitude076-51W -timeZoneEAST
ERN
-nameScott AFB -icaoIdentifierKBLV
O
C-9BAircraftType
Timeline
-nameC-9B -speed450 knots
LALocation
Key O Origin D Destination
-latitude33-57N -longitude118-24W -timeZonePACI
FIC
D
13
Class Critique
  • Multiple instances must be possible
  • Each uniquely identifiable
  • Cant be subdivided into distinct classes
  • Multiple attributes needed to describe
  • No empty attribute values
  • Methods needed
  • At least for creation and modification

14
Attribute Critique
  • Naturally describes the object
  • Does not describe some other object
  • Value will be known for some instances
  • Value will never be empty
  • Cannot be subdivided into smaller attributes
  • One value, not a list of values
  • Cannot be computed from other attributes

15
Relationships
  • Object relationships
  • Has-a
  • Aggregation
  • Composition
  • Class relationships
  • Generalization (extends)
  • Implements

16
Practice Exercise
  • Create a Class Diagram for an academic transcript
  • 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

17
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

18
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 todays class.

19
FlightFinder Class Diagram

Location latitude longitude distanceTo() timeZon
e()
Airfield name icaoIdentifier location display()
Flight flightNumber aircraft legs display()
Options keyboard routes compute() display()
Route legs display()
Leg flight departureField departureTime arrivalFi
eld arrivalTime availableSeats display()

Aircraft type display()

Schedule webpage readFlight() readDate() display
()
Write a Comment
User Comments (0)
About PowerShow.com