ist 311 – object-oriented design & software
DESCRIPTION
IST 311 – Object-Oriented Design & Software. Steven Haynes IST 311 – Class 7 17 January 2006 [email protected]. Mid-Term Deliverables. Use Case diagrams Derived from scenarios Class diagram Conceptual Sequence diagrams TBD Need use cases first User Interface Design - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/1.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
IST 311 – Object-Oriented Design & Software
Steven Haynes
IST 311 – Class 7
17 January 2006
![Page 2: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/2.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Mid-Term Deliverables
Use Case diagrams– Derived from scenarios
• Class diagram– Conceptual
• Sequence diagrams TBD– Need use cases first
• User Interface Design– Need use cases first
• Due Thursday, March 3rd (Thursday before break)
![Page 3: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/3.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Design Representations
• Why learn the UML?
• What is the purpose of design representation languages and techniques?
![Page 4: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/4.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Design Representations
• An aid to design cognition
• A common language for communicating about a design (specifications)
• A record of the design process and its outcomes (documentation)
![Page 5: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/5.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
UML Diagrams, Part 1.
• Use Case diagram
![Page 6: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/6.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
UML Diagrams
• Use Case diagram– Identify major services provided by a system to
external actors (users and other systems)• Establish the boundaries of the system
• Identify common functionality
• Identify high-level alternate use scenarios
– Capture requirements– Development project planning tasks– Communicate with the customer/user.
![Page 7: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/7.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Use Case Diagram
Customer
Purchase Gas
Initialize Pump
«uses»
Card Purchase
«extends»
Bank System
Print Receipt
«extends»
![Page 8: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/8.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Use Cases
• Actors• Use Cases• Include (Uses) Use Cases• Extend Use Cases• Annotations
– Pre-conditions
– Post-conditions
– Constraints
• Don’t use actor or use case generalization
![Page 9: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/9.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Guidelines for Use Cases
• Actors – specific user roles• Human actors on left• Non-human actors (systems) on right• Use Cases – verb-noun phrase• e.g., Verify Credit Card• Include (uses) link – included use case MUST be
completed for the including use case to complete• Extend link – extending use case represents a
variant of the extended use case
![Page 10: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/10.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Guidelines for Use Cases
• Use cases model system interactions.
• Use case granularity THE big problem
• Use annotations (notes) freely to document your assumptions.
• Use cases are not data stores
• Use cases are not data flow diagrams
![Page 11: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/11.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
UML Diagrams
• Class diagram
![Page 12: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/12.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
UML Diagrams
• Class diagram– Identify classes
• Attributes
• Operations
– Identify class relationships– Identify packages– Describe a system’s static structure
![Page 13: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/13.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Class Diagram
+Pump_Controller_UI()+createTransaction()+monitorCardReader()+sendAttendantMsg(in message : String)+initializePump()+getSelectedFuelProduct()+promptSwipeCard()+startDispenser()+transTypeButton2_actionPerformed()+setCustomerMsg(in msg : String)+setFuelProductLabel()
-startButton-cancelButton-transTypeButton1-transTypeButton2-transTypeButton3-gradeSelectButton1-gradeSelectButton2-gradeSelectButton3-customerMessage : JTextArea-unitsDispensed : JTextField-totalSaleAmount : JTextField-pricePerUnit : JTextField-pumpNumberField : JTextField
Pump_Controller_UI
+createDispenser()+calcTotalSale()+printReceipt()+Transaction()
-totalSaleAmount : double-unitsSold : double-date : String
Transaction
+verifyCard() : boolean+chargeCard()
-cardCompany : String
Credit_Card
+printReceipt()+Card_Transaction()+cardReaderReady() : boolean
Card_Transaction
+verifyCard() : boolean+chargeCard()+Payment_Card()
-cardNumber : String-nameOnCard : String-expirationDate : String-cardVerifiedIndicator : boolean-amountAvailable : double
Payment_Card
+verifyCard() : boolean+chargeCard()
-cardBank : String-pinNumber
Debit_Card
1
1
1
*
![Page 14: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/14.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
UML Diagrams
• Sequence diagram
![Page 15: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/15.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
UML Diagrams
• Sequence diagram– Describe the sequence of steps required to
realize a use case or use case scenario, which represent requirements
– Describe interactions between objects/classes– Perspective is time oriented
![Page 16: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/16.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Sequence Diagram
aCustomer
aPump_Controller_UI
Pump_Controller_UI()createTransaction()
aTransaction
Transaction()
![Page 17: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/17.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
UML Diagrams
• Collaboration diagram
![Page 18: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/18.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
UML Diagrams
• Collaboration diagram– Same as Sequence diagram except…– Perspective is structural or spatial
![Page 19: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/19.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Collaboration Diagram
Customer
: PC::Pump_Controller_UI
1: transTypeB
utton2_actionPerform
ed()
: PC::Card_Transaction
2: C
ard_
Trans
actio
n()
: PC::Card_Reader
3: Card_R
eader()
4: card
ReaderReady:=
cardReaderR
eady()
5: setCustom
erMsg(m
sg:String)
: PC::Payment_Card
6: Paym
ent_Card()
7: v
erify
Car
d:=
verif
yCar
d()
mon
itorC
ard
Rea
der(
)
![Page 20: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/20.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Degree Audit Use Cases & Classes
![Page 21: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/21.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Eclipse Tutorial
![Page 22: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/22.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Assignment for Thursday
• This is an individual assignment.
• If you have not had Java it will take some time so don’t wait too late to start working.
• Read Raposa Chapters 1 through 3.
• Do problems on the next two slides.• For this assignment you can use the Java SDK for the labs,
as described in the book, or Eclipse.
• Due at the start of class Thursday, 1/19.
![Page 23: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/23.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Assignment Lab 1
• Write a public class called CreditCalculator and declare the main() method within the class.
• The value for currentCredits will be input from the command line. Command-line arguments are strings so you’ll need to convert the value of currentCredits to an integer within main():int currentCredits = Integer.parseInteger(args[0]);* Hint Run menu:Run, then the Arguments tab
• Write a method to calculate creditsNeeded given the value of currentCredits. Display the result.
• Save, compile, and run your program. You’ll need to enter the command-line argumentjava CreditCalculator 62
![Page 24: IST 311 – Object-Oriented Design & Software](https://reader036.vdocuments.site/reader036/viewer/2022062407/56812c61550346895d90f3d9/html5/thumbnails/24.jpg)
ist.psu.eduist.psu.edu
School of Information SciencesSchool of Information Sciencesandand TechnologyTechnology
Assignment Lab 2
• Extend the main() method in your CreditCalculator class to calculate the number of semesters remaining given 15 credits per semester.
• Also, if the number of currentCredits is >= 120, output the string “You can graduate!”