CPSC 211 10S Term Project
Part 3: Implementing a Music Library Application

DUE: Sunday July 18, 20:00

Assignment Overview

In part three of the project (aka assignment three), you will continue work towards building a music library application. In this part of the project, you will implement all of the main classes (except the GUI and provided MP3 playback library) for the application. We will give you a skeleton code to work from and a driver program (text-based interface) that you can use to test what you have done.

Requirements for this Assignment

In this assignment you will implement the Library, Song, Artist and Album classes for the application. In the code provided, you are given method stubs for all methods you need to implement. In addition to these, you will need to implement equals(), compareTo() and compare() methods where appropriate. Some requirements and guidance for implementation are given below. You are given a driver class (text-based interface) which acts as a text-based interface to test your code (and offers some basic MP3 playback functionality too! When you develop your GUI, you will harness the full power of the MP3 library to play, pause, stop, seek MP3 files).

Here is a UML diagram representing the relationships between core classes of the music library project.

For added context, the following diagram shows how the interface (in this case, a text-based driver -- later, your GUI) interacts with the core application and provided MP3 library.

Implementation Requirements

·       Methods that add Songs, Artists or Albums to the library and/or provide associations between entities (e.g., adding an artist to a song) should be careful to update all involved objects. When linking, for example, and Artist with a Song, the Artist object needs to know about the Song, and the Song object needs to know about the Artist. In this case, the Song class's addArtist() method should ensure that the associated Artist object knows about the Song to which it was associated. (And vice-versa for the Artist class's addSong() method if this was called instead.) The goal is to make sure that there are no inconsistencies between data structures after method calls.

·       SortedSets must store their data ordered as follows:


To meet this requirement, you will probably need to have some classes implement the Comparable interface and/or write Comparator classes and associate them with SortedSet objects.

·       A reminder that Songs are uniquely identified by path, Artists are uniquely identified by name, and Albums are uniquely identified by title. Be sure that this uniqueness guarantee is upheld by your application.

·       Javadoc has been provided for each method that you are required to implement. Confirm that your methods meet the requirements of the Javadoc before submission.

Loading Assignment Code

1.   Save the assignment files CPSC211-A3-SuppliedFiles.zip in a directory on your computer.

2.   In Eclipse, create a new Java Project (File->New->Java Project). Let's assume you have named this project "AssignmentThree".

3.   Right click on the AssignmentThree project in the PackageExplorer. Select Import. Expand the General category and select "Archive File". Press Next. Open up the CPSC211-A3-SuppliedFiles.zip archive file. Click "Finish".

4.   When prompted, allow the imported files to overwrite your .classpath files.

You should now have several packages in your project. All of the changes you'll need to make are in the Library, Artist, Album and Song classes in the ca.ubc.cs211.mp3.library package. You JUnit tests should be put in a new package called: ca.ubc.cs211.mp3.junit

JUnit Tests

·       You are not required to write JUnit tests for every method you have written, but we recommend you do so for the most complicated ones.  Don't worry about testing simple getter and setter methods. Just test the more complicated methods. Use your judgment to write tests to supplement the text-based driver that prove that you have implemented everything required successfully.

·       Nevertheless, you must write and submit JUnit tests for the following methods of the Library class:

§         getArtistByName(String s)

§         addSong(String title, String path, int track)

§         removeArtist(Artist a)

·       For each of the three methods listed above you must provide black-box tests that cover the equivalent classes of the methods input space.  For each equivalent class you must provide typical and appropriate test cases.  Make sure that you have documented well all your test cases. 

Testing Your Code with SimpleTextInterface

·       If everything is implemented correctly, you can use this program to test your code. You can load a sample music library we have created for you in the text file sampleLibrary.txt, by doing the following.

§         Download the SampleLibrary.txt file and save it on your directory for this assignment.

§         Run the SimpleTextInterface (in the  ca.ubc.cs211.mp3.ui package).

§         From the menu select to “Import library from text file”. When you are prompt for the file name, type the full path and name of the sampleLibrary.txt file (must provide the full path, otherwise it won’t find the file).

§         Navigate through the menu to add, remove, and inspect your Library. Look to ensure sets are ordered appropriately and that all add/remove/edit functionality works as it should. NOTE that MP3s will not play unless the paths in your Song objects are correct. The sample library assumes there are MP3s called 1.mp3 - 8.mp3 in the C:\ folder. Feel free to edit the sample library to refer to valid paths on your computer (or use the interface to create new Songs).

Grading

The following criteria will be used to grade this assignment:

·       The correctness of the  implementation of the provided classes. (Does your code implement the required methods correctly?)

·       How well your JUnit tests cover the three methods of the Library class we listed above. 

·       How well your code runs with the SimpleTextInterface

·       The clarity and readability of your code. (How easy will it be for someone else to read your code? Did you use helper methods to make your code easier to read? Did you keep it simple? Do you implement the methods in a simple way?)

Handing in the Assignment

You should develop the assignment with your partner, but in the end only one of you will submit the final version for both of you.  Do not submit more than one copy for each group.  The person who will submit the project should do the following:

1.   If you have not done so, create a directory named cs211 inside your home directory.  Inside cs211 create another directory named part3.

2.   Go to Eclipse. From Ecipse, select the Java project in the PackageExplorer that contains your implementation of part three of the project, say it is called "Assignment Three".

3.   With "Assignment Three highlighted, right-click in the PackageExplorer and select Export. Expand the General category and select Archive File. Press Next. Save the archive to <your home directory>/211/part3.

4.   Copy the cover page for this assignment in the directory part3 and fill it in. Make sure that your partner has also filled in his/her part in the cover page.

5.   When you are ready to hand in, use:

            handin cs211 part3

6.   Now check that the handin process was successful with the command:

            handin -c cs211 part3

You will see a list of all the files that were submitted. Check that you have submitted the necessary files and that you haven't submitted any extraneous files.

 


 Last Updated: July 07, 2010 03:42 PM