->Homepage
->Schedule
->Courses
-->CS183
-->SE281
-->Tentative Schedule
-->Objectives
-->Quiz 1
-->Lab 1
-->Lab 2
-->Lab 3
-->Lab 4
-->Lab 5
->Course Policies
->Electronic Submission
->Documentation Standards
->Old Exams
->C++ Examples
->MSVC++ Info
->Software
->Support Forum
->Unix Info
->Nature Photos

[Home]
[Rich][Home][Rich]
[Author]
SE281 -- Lab 2: Adapter Pattern

Spring 2004

Objectives Addressed
  • understand and apply object-oriented design patterns
  • understand the use of UML in the design process
  • be able to design and implement small software components and systems
  • be able to use computer-aided software engineering (CASE) tools in the design process
Overview

The purpose of this lab is to gain experience with the adapter pattern.

Problem Statement

You should add open and save member functions for the DesktopItem and derived classes from Lab 1. You can copy and paste the implementations of the three classes from this file.

The open and save functions should read and write the contents to files on the hard drive using file streams. Rather than actually creating a directory structure on the hard disk, you should save all files in the same directory. Files that are contained in folders will be saved by prepending the folder name and a comma to the filename. For example, if you have a folder called labs with two files called lab1.txt and lab1.wav in it, you should save the list of filenames in lab, the contents of lab1.txt in a file called labs,lab1.txt, and lab1.wav in a file called labs,lab1.wav. Also, you should not allow standard filenames to contain commas (you should modify the class implementations to prevent this).

Create a Wav class that adapts the .wav file reading code found here. Your class should work with the Folder class from Lab 1.

In addition, you should write a program that will read at least one of each file type and place each file type in a newly create a folder. The program should then display to the console the file size of the folder and the size of each file, and save the folder (which should save all of the files in the folder).

Lab report (due 11:00pm, the day prior to week 4 lab)

Here is a template file to use as a starting point for this report.

The lab report should consist of the following:

  • A link to your Rational Rose model file, and a .png image with the UML diagram describing the Wav class.
  • Your reaction (a couple of paragraphs on what you learned and what you thought about while working on this assignment)
  • Any suggestions you have for how the assignment could be improved.
  • An activity log indicating how much time you spent on each phase of the assignment. You should use the format found in the template XML file and report the time in the following categories:
    • Modeling
    • Design
    • Coding
    • Debug (before you think it's working)
    • Test (after you think it's working)
    • Writing Report
    • Other
  • The documented source code for your program.

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the XML help video and/or sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost.

Acknowledgment

This laboratory was developed by Dr. Chris Taylor.

Last Updated: Friday, 26-Mar-2004 15:17:23 CST