Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Spring 2004 Midterm 2 Review Page
Midterm 2 will include questions on the material covered since the first exam. Some questions that will help you prepare are found below. More will be added.
I recommend working together to figure out the solutions. I will check up on the discussions, but I won't provide answers where no questions are posted. Rich LeBlanc
Designing the Segway Palm
Palm has just announced a new kind of handheld
device designed specifically for attaching to the Segway
Personal Transportation device
SegPalm will feature a map with GPS (``Global Positioning
System'') for finding your way around town, an MP3 player and FM
radio, a cellphone, and a Zagat's guide to the restauraunts around
town, as well as the traditional appointment book, to-do list, and phonebook
Palm wants some of these features to interoperate. For example:
- The single speaker jack should be internally connectable to
either the radio source or the MP3 source. The volume control effects
the speaker jack directly, while the band selector effects only the
radio source and the clip selector effects only the MP3 source.
- Map objects will be used by the GPS locator (e.g., to
tell you where you currently are), by the Zagat's guide (e.g.,
to show you where the nearest Starbuck's or Waffle House is),
and by the address book (e.g., to show you where your Aunt
Millie's house is and the quickest way to get there). This
means that the map needs to be indexed both by global GPS
coordinates and in terms of street addresses, e.g., the maps
have to know the GPS coordinates associated with 800 Atlantic
Drive. Locations in the address book and in the Zagat's guide can be
specified in terms of either GPS coordinates or in terms of street
addresses, and the Map objects have to handle translations between them.
A single Location will appear on multiple Maps, and if the Location is
asked for its coordinatesInGPS or coordinatesOnStreet, it should know
one of those and be able to ask any of its Maps for the other. A Map
should know how to map any Location to its own graphical
representation, such that the Map can highlightFor any Location.
- Draw a UML class diagram for the interactions between Maps,
Locations, the address book, and the Zagat's guide, including any
additional objects you think are necessary. You must account for all
of the functionality described in this problem, but you needn't add
any other (e.g., you don't have to handle the address book user
interface). You do need to show attributes and services that would be
necessary to implement the given functionality. Describe
briefly what each of your services would do.
- Identify one design pattern that would be useful in this
problem. Explain how it would be useful, and identify specific
classes that you would use in a design for this problem that would
correspond to the design pattern participant objects.
- Palm is using Squeak to implement the SegPalm.
Imagine that you have an ordered collection errands of
Location objects that represent places to which you have to
run errands. You have a Map gridMap on which all the
Locations appear. You are to write workspace code:
- To tell gridMap to highlightFor each of these
- To ask each of the errands locations for its
streetname (assume given, returns a string with the name of the
street). For each street containing more than one errand
location, print to the Transcript a message announcing ``There is
more than one errand on street: '' with the street name.
Post comments, discussion, answers at Spring 04 Midterm 2 Review: Segway Palm.
You are going to be designing a suite of tools for space scientists. Your scientists are going to need to work with three kinds of documents:
- Data Collection Documents: Containing live satellite data in a form appropriate for doing numeric calculations with.
- Data Visualization Documents: Does 2-D and 3-D graphs of satellite data linked to it.
- Data Planning Documents: For organizing modules both on the satellite and off for gathering and processing sensor data.
a. Explain how one (your choice which one) Design Pattern would be useful in building this application. Draw a UML class diagram of the portion of your design where the design pattern would be useful. (Note: You are not drawing the whole class diagram, nor are you showing me the structure of the Design Pattern. Rather, you are showing me a few classes in your application whose design would be based on the Design Pattern you've selected.)
b. The Space Scientists think this object-oriented stuff is just silly. "Fortran was good enough for my advisor and for me and for my students," they say. "Why not just use that?" What are the advantages of object-oriented design and programming for this problem?
Post comments, discussion, answers at Spring 04 Midterm 2 Review: Tools for Space Scientists
a. Factory Method and Abstract Factory design patterns are quite similar. How are they similar and how are they different?
b. How are the Adapter and Bridge patterns similar and different?
Post comments, discussion, answers at Spring 04 Midterm 2 Review: Design Patterns
Testing Object-oriented Programs
a. How is testing an object-oriented program similar to testing any other kind of program?
b. What are the features of object-oriented programs that require new testing approaches? What impact do they have on the testing process?
c. Explain what unit testing means for an object-oriented system.
Post comments, discussion, answers at Spring 04 Midterm 2 Review: OO Testing
Multimedia Programming in Squeak
I probably won't ask you to write this much code on the exam, but knowing the techniques required would be a good idea.
Recall that you can play three notes in Squeak like this:
(FMSound soundNamed: 'brass1')
from: #((c4 1.0 500) (d4 1.0 500) (e4 1.0 5000))) play
"Triplet are note, duration, and volume"
(a) Recall, too, how to move a Pen, from wherever the Pen appears when first created.
Write the Squeak code to draw a box, where you play C in the fourth octave during the first line, D in the second, E in the third, and F in the fourth – as a clarinet.
(b) Recall that moving a Morph involves setting its bounds: to a new rectangle. Recall that you change the color of a Morph with a color: command.
Write the Squeak code to move a red EllipseMorph. Start it at 0,0 and play C; then go to 0,100 and play a D; then go to 100,100 and play an E; and finally go to 100,0 and play an F.
Post comments, discussion, answers at Spring 04 Midterm 2 Review: Multimedia Programming in Squeak
You are a consultant to the WhizO Toy Company ("Makers of toys for tots of all ages"). WhizO is considering a shift to an object-oriented software development process. If they do make such a shift, you're in for big bucks as the consultant who leads the way. First step is to respond to the specific concerns of the Manager of their Software Development unit:
- "We usually have multiple teams of developers working on different parts of the programs at once. How does object-orientation help us with that?"
- "We rely heavily on simulation when developing sophisticated toys. What would be absolutely perfect would be if we could take parts of our simulation and use it in the code for the real toy. Can we do that? How?"
- "What happens if we develop add-ons for a toy, like a new Laser Gun for our Omega Video Game System? Or if we develop a new variation on a toy, like the Phaser Range Finder Gun (which is like the Laser Gun)? Can O-O help our productivity in doing this?"
Post comments, discussion, answers at Spring 04 Midterm 2 Review: Whiz-O Toys
Design an Alarm System
Design an alarm system for installation in homes or businesses. You may assume that someone else is creating sensors and the mechanism to trigger alarms. You have to create the software to respond to alarms and to alert authorities.
- For any kind of alarm, you need to send all the alerts necessary for a given alarm. For example, for all fire alarms, the fire department is always called. The head of the house or business is always called for all alarm, and one or more "local experts" might also be called. For example, if there is a fire or intruder in the warehouse, the warehouse manager should also be called.
- You need to respond to Intruders by sounding the audio alarm in the vicinity. Assume that you just send the message trigger to the audio alarm object and it will sound.
- You need to respond to Fire by triggering the sprinklers in the vicinity, if available. Assume that you just send the message trigger to the sprinklers object.
- Your system is pretty sophisticated with respect to alerting authorities. It can handle IP or phone messaging. You can assume that the messaging is handled by another piece of the system. You need to provide the address of the authority (i.e., either a phone number or an email address) and the message to be sent (which should include, for example, the kind of alarm and the alarm vicinity).
Draw the UML class diagram for this class structure. (You don't have to add more features than what's described.) Note: Partial credit will be given, so err on the side of too much, not too little. In your analysis, be sure to address:
- What classes do you need? What service do each need to provide? What attributes do each need to know?
- Where are there generalization-specialization relationships? Where are there part-whole relationships?
Note! This is an important one!
Displaying the Current Status. You must now provide an interface for your alarms: An AlarmStatusView that shows that status (triggered by a sensor or still waiting) of each alarm.
How do you efficiently implement View/Model communication? Be sure to tell me (a) how the AlarmStatusView finds out an alarm being triggered and (b) how it finds the vicinity of the triggered alarm to display.
Post comments, discussion, answers at Spring 04 Midterm 2 Review: Displaying Alarm Status
Link to this Page
- Reviews last edited on 24 July 2007 at 2:44 pm by balladeer.cc.gatech.edu