Jukebox Active Learning - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Jukebox Active Learning

Description:

The jukebox must allow students to play a song. No money will be required. ... The words floating around the room while analyzing the problem Alistair Cockburn ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 14
Provided by: rickm1
Category:

less

Transcript and Presenter's Notes

Title: Jukebox Active Learning


1
Object-Oriented Software Development
By Rick Mercer with help from these
sources Computing Fundamentals with C, Rick
Mercer Designing Object Oriented Software,
Rebbeca Wirfs-Brock, Wilkerson,
Wiener Object-Oriented Design Heuristics, Arthur
Riel
2
Outline
  • In the context of the Jukebox case study, follow
    along as a team
  • analyzes a problem specification
  • Designs a solution as a set of candidate objects
    with well-defined responsibilities
  • Role plays different scenarios to understand the
    problem and help make design decision
  • We'll also consider some design heuristics

3
Goals of the OO Analysis
  • 1. Identify candidate objects that model a system
    as a sensible set of abstractions
  • 2. Determine the responsibility of each object
  • what an instance of the class must be able to do,
  • and what each instance must know about itself
  • less important at first
  • 3. Understand the system through role play
  • To help complete its responsibility, an object
    often needs help from other objects

4
Analysis Tools
  • Nouns (objects) Verbs (operations)
  • Scenarios
  • what happens when
  • Role Playing
  • team members become objects and do scenarios
  • (C)andidate Object / (R)esponsibility/(C)ollaborat
    or (CRC) cards
  • document candidate objects, assign
    responsibilities, consider associations between
    objects

5
The Problem Specification
  • The student affairs office want to put some
    newfound activity fee funds toward a jukebox in
    the student center. The jukebox must allow
    students to play a song. No money will be
    required. Instead, a student will swipe a
    magnetic ID card through a card reader. Students
    will each be allowed to play up to 1500 minutes
    worth of "free" Jukebox music in their academic
    careers, but never more than two selections on
    any given date. The jukebox must make sure that
    the same song is never played more than four time
    a day (what a drag to hear "I Honestly Love You"
    10 times) apologies to Olivia Newton John

6
1. Find the Objects
  • Candidate objects may come from
  • The problem statement
  • An understanding of the problem domain
  • knowledge of the system that the problem
    specification may have missed or took for granted
  • The words floating around the room while
    analyzing the problem Alistair Cockburn
  • Object-Oriented Design Heuristic
  • Model the real world whenever possible

7
The Noun Phrases
  • student affairs office
  • activity fee funds
  • music Jukebox
  • money
  • student center
  • student
  • student ID card
  • card reader
  • song
  • minutes
  • Jukebox music
  • academic careers
  • date
  • selection
  • CD
  • collection of CDs

8
A First Cut at the Candidate Objects (may become
classes)
  • Jukebox
  • Student
  • Song
  • Card reader
  • Student ID card
  • CD
  • Collection of CDs

9
Yesses
  • Jukebox coordinates activities
  • one instance to start things and keep them going
  • JukeboxAccount (was Student) maintain one
    account a model a user that can select
  • Song one song on a CD
  • CardReader reads the magnetic ID card

10
A No
  • StudentIdCard store user data
  • Object-Oriented Design Heuristic
  • Eliminate classes that are outside the system
  • The hallmark of such a class is one whose only
    importance to the system is the data contained in
    it.
  • Student identification number is of great
    importance
  • The system should not care whether the ID number
    was read from a swiped magnetic ID card, typed in
    at the keyboard, or "if a squirrel arrived
    carrying it in his mouth" Arthur Reil

11
More Candidate Objects?
  • CD store a collection of songs
  • CdCollection stores a collection of CDs
  • What about storing a collection of accounts?
  • JukeBoxAccountCollection
  • What about a compact disk player?
  • CdPlayer plays the songs
  • could have a software equivalent to talk to this

12
Another No?
  • StereoSystem Amplifies the music
  • No, it's on the other side of the physical
    CdPlayer
  • The next slide summarizes some needed candidate
    objects
  • It also sets the boundaries of the system
  • There are model of the real world objects

13
Candidate Objects and the system boundary
CardReader Gets student ID
JukeboxAccountCollection Stores all
JukeboxAccount objects
JukeboxAccount
JukeBox Coordinates activities
CdCollection Stores all CDs that can be played
CD
CdPlayer Plays a song
CdTrack
Write a Comment
User Comments (0)
About PowerShow.com