150 likes | 273 Views
CPSC 233 Tutorial. Xin Feb 7, 2011. Object Oriented Design. Gathering requirements Finding the classes Finding the attributes Finding the methods. ATM -- requirements. A user has only one account A user can view balance, withdraw, and deposit
E N D
CPSC 233 Tutorial Xin Feb 7, 2011
Object Oriented Design • Gathering requirements • Finding the classes • Finding the attributes • Finding the methods
ATM -- requirements • A user has only one account • A user can view balance, withdraw, and deposit • Cash dispenser begins each day loaded with 500 $20 bills. • Simulate the process inside a computer screen keypad cash dispenser deposit slot
Use case diagram • A type of UML diagram (among 13) • show the kinds of interactions
Identifying the classes • Derived from key nouns and noun phrases • Pick out important and relevant candidacies
Have-a relationship • a bit different from that in Prof. Tam’s slides
Finding attributes • Derived from descriptive words and phrases that refer to characteristics of the classes • Pick out the important words and phrases
Finding methods • Derived from key verbs and verb phrases • determine methods • some methods need cooperation of more than one classes • determine parameters • determine return types
The end • Thank you!