I. Object-oriented design: a way to think about organizing programs A. goals ------------------- clients | impl ------------------- B. responsibility-driven design method 1. for each action, find an object to be responsible for it. 2. CRC cards a. on front (spec) ----------------------- CRC CARDS ClassName | Collaborators --- | Responsibilities | ... | ----------------------- b. MVC example -------------------------------------- CRC CARDS for Model, View, Controller View | Controller --- | Model Render the Model | Transform coordinates Controller | View --- | Model Interpret user input | | Distribute control | Model | --- | Maintain problem info| | Broadcast change | notification | ---------------------------------- c. Lottery example ---------------------------------- LottoCustomer | --- | remember how much | willing to lose | play lottery some # | Lottery of times | Lottery | --- | pick winning ticket | WinningTicket | UniformDiscrete tell how much ticket | has won | Ticket | --- | hold 7 distinct | integers | WinningTicket | --- | (as in Ticket) | tell number of matches| Ticket to a Ticket | UniformDiscrete | --- | remember how many to | pick from | give set of distinct | numbers of a size ---------------------------------- d. CRC cards on back (implementation design) C. exercises 1. ATM banking machine 2. A kitchen management system.