This part of the assignment comes after the first three lectures of the module. It tests the use of the some of the main techniques covered in the module so far, these being:

  • UML
  • OO Design
  • OO Programming Techniques
  • Collections

You will be expected to demonstrate the ability to use these techniques and will lose marks heavily if you do not use them. You will also have to learn and use a new technique called serialization.

The Task

You are to design a program in UML which allows you to record the details of your music collection, both that on CD and downloads (we’ll ignore vinyl etc.). You then need to implement this as a console application. The second part of the assignment will involve converting the console application to a GUI program (Windows Application) and you should bear this in mind when producing your design.

To test the program you will need to use a fair amount of data, and you will need to save/load this data to/from a file (or files). You need to get this part going very early on as you will have great difficulty progressing if you don’t.

There are several approaches that you can use for saving the data, however, for this assignment you must use one which you have yet to be taught. The technique you are expected to use is called serialization. Using serialization is the neater approach than using stream readers/writers, but since you have not covered this in the lectures you will have to research it yourself (either in Help, books, the web or all three – incidentally, learning to use Help is an important part of learning to program, so no matter what you should check this in Help even if you use additional sources).

There are two types of serialization, binary serialization and XML serialization. For this assignment you should be using binary serialization. You may have to implement the ISerializable interface, but hopefully you won’t have to and will only need to use the serialization attribute ([Serializable]) in a couple of places. You will need some rather awkward using statements to do this, so I’ll give you these for free:

using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

Since you have to research this yourself, this approach will carry a reasonable amount of marks.

It will be easiest if you assume all music is in an album of some sort. If you have a (download) track which you don’t know where it came from, assume it is from an album called .

You will need a class to hold the details of an album. The details of the album that you need will be the title of the album, artist and a list of tracks. The title and artist will both be stored as simple strings. Also you need to know the type of album, i.e. whether it is a physical CD, an album ripped from a CD, a downloaded track or a hybrid/combination of the last two (partly ripped, partly downloaded). You should think carefully about how you want to manage this. Also, you may have the entire album, or maybe you only downloaded one (or a few) tracks off a given album. Again, careful thought about managing this.

Compilations of tracks by several artists will also provide a problem. Such albums should be of a derived class called something like “CompilationAlbum” or “MultiArtistAlbum” and should always give the artist as Various Artists.

It is probably worth defining a class to hold track details as well. For each track you must store the title (a string) and track number (an integer). These should be read only properties (set by the constructor – which will need a list of the tracks as well). You must store the tracks in a standard generic container. The tracks should be stored in the list in the order that they appear on the album. Bear in mind that you may download one or two tracks from an album then download a few later (i.e. you need to be able to add tracks one at a time to incomplete albums). Test and get the class working.

When you have the album class(es) working you can now create the music collection class. This should have a generic collection of albums (either by containment or by inheritance, it doesn’t matter which).

The album collection class should have functions/methods to allow you to:

  • Add a new album
  • Delete an album
  • Find an album by name and artist then list all the tracks on the album
  • Find a track by name then list the album(s) (with artist) artist that it is on – there may be multiple versions of a song or there may even be different songs with the same title – there have been several songs called “Tonight” (but I only know one called “It Takes a Lot to Laugh, It Takes a Train To Cry”!!!)
  • Add a track to an existing album (you may download two tracks off an album then decide that there is a third you’d also like at a later date)
  • Load the album collection from file
  • Save the album collection to a file

You must think carefully about whether you want to add load/save functions to the album class to help the load/save functions of the album collection class (it is possible to get it to work either way).


Put display methods in classes so you can test as you go along. If you write the whole program in one go and then try to debug it you have very little chance of getting it to work. Develop the work in stages, do one part and TEST IT THOROUGHLY before going onto the next stage. Only ever add to working code and only add one new thing before testing. Failure to work methodically like this will probably result in failure. You must not cut corners or you will fail.

What You Need To Do

  • Draw up a UML design for this system
  • Code up the design of the system
  • Write a test harness for this (i.e. the music collection class)
  • Test the program

A menu based test harness will suffice. One of the main reasons for insisting that you can save and load the users is that it will simplify testing for you. You must ensure that you can test the use of both types of user and also that you can save and load both types of user to/from the same file.

Producing the UML Diagram

You must hand in a paper copy of the UML diagram. You must produce the diagram electronically; hand drawn versions will not be accepted. Also, class diagrams generated from Visual Studio will not be accepted (as this is not standard UML). You may use any other tool of your choice including Visio (which has UML templates) or even Paint. In the labs we have Enterprise Architect which would be a good tool to use. We cannot supply this to you, but you could buy it. Alternatively, diagrams produced from the evaluation version (which will remain active for a month) would be acceptable (I will ignore the markings in printouts which say it is the evaluation version). See the Sparx Systems website for details.

Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.