Objectives.
● Practice working with a partner to design and implement software.
● Practice using Github to collaborate and keep track of code.
● Utilize data structures and library classes provided through Java.
● Design and implement working software according to good design principles from the course.
● Provide strong evidence that the software works as expected through unit tests and running the software.
● Document software and the design process using tools covered in class, including UML diagrams.
● Optional: Practice using AI software for generating working code. *** (NOTE: This is only allowed in part of the assignment, so read the instructions carefully to make sure you do not violate the academic integrity policy.)
● Understand the purpose of the model (M) and the view (V) in the MVC design pattern.
● Organize code into appropriate packages and create an executable jar file.
Project Overview
For this project, you are required to work with a partner to implement software for managing a music library. There are three main components to the code, and there are several other non-code requirements as well. Each part has specific instructions and requirements (including varying policies on use of AI, so read and follow all the instructions carefully).
Part 0. Email the following people with the names of the two people who will be working together on this by Friday, February 14, 2025 at 11:59 PM. We need this information in order to set up the groups on D2L, so it is part of your grade!
Email all three of these addresses:
[email protected],
[email protected]
[email protected]
Part 1. MusicStore.java
Note: You must code this part yourself without any help from AI or any other unauthorized resources. In other words, the regular academic integrity policy applies for this part of the assignment.
You are allowed to use any library APIs available through Java, but keep in mind that if you are using anything unusually advanced, you may be asked to explain your code.
This part of the code is separate from the main application, but we need to provide a pseudo-database of music to work with. You should implement this in a class called MusicStore.java. The main idea here is to store the music, so that the main application (the user library) can interact with it in an efficient way. This means that it is a great opportunity to use some of the data structures that are provided through Java library code.
You are provided with some text files that include album information. A sample file is given below with some comments to explain the general format that all these files follow. Note that all the albums are named with the same format: _.txt
For example, the album shown below is in the file named Old Ideas_Leonard Cohen.txt .
Old Ideas,Leonard Cohen,Singer/Songwriter,2012
Going Home
Amen
Show Me the Place
Darkness
Anyhow
Crazy to Love You
Come Healing
Banjo
Lullaby
Different Sides
The first line of the file is the heading, which is in the following format:
Album Title,Artist,Genre,Year
The rest of the file is a list of the songs on the album. Note that albums have a specific order, so you should make sure to store these in the order that they are listed.
In addition to the files containing individual albums, there is also another file called albums.txt, which contains a list of all the album titles and artists in the following format:
<Album Title>,<Artist>
Your code will need to read each item from the albums file, construct each album’s file name, and then read in the album information.
To do this, I recommend you check out the following APIs:
● java.lang.String – has some very useful methods for splitting Strings
● java.lang.String – has some very useful methods for splitting Strings
Note: You should read the rest of this document before you start working on Part 1 as your design will depend on the music store’s client, which is the LibraryModel described in Part 3.
Before getting into the details of the user library we need to briefly explain what MVC is. MVC stands for Model-View-Controller, which is often considered a design pattern, but may be more appropriately considered a higher-level concept of an overall architecture. Many applications use versions of MVC because it clearly separates the model, the view, and the controller.
For this particular assignment, we will not be using the Controller part because with a text-based UI, it doesn’t really do much. We will revisit the idea later when we start talking about GUI’s and event-driven programming. For now, we will focus on the Model (M) and the View (V).
Briefly, the Model is where the data is stored and managed. So in this library application, it will store the user’s library data and control how the data is accessed. It does not communicate directly with the user, so there should be no user input and no printing to output anywhere in the model. All code that interacts directly with the user through user input and printing to output should be restricted to the View.
One way to think about this is to keep in mind that all Model-related code is in the backend and all View-related code is in the frontend.
The View is the part that the user interacts with. It has two main jobs in this application:
● prompt the user for commands, get those commands, and communicate those commands/requests to the model
● receive the requested data from the model and display it to the user–in this case through a text-based user interface
You are required to implement your project with a clear separation between the model and the view.
Part 3. The Model
You should think of the Model as not just a single class but a collection of classes. However, you should also specifically have a LibraryModel.java class that keeps track of the user’s library and interacts with other classes including the View and the MusicStore. But you can (and should) create other classes to model some of the objects that will be used, such as Song, Album, and PlayList.
Note: You must code this part yourself without any help from AI or any other unauthorized resources. In other words, the regular academic integrity policy applies for this part of the assignment.
You are allowed to use any library APIs available through Java, but keep in mind that if you are using anything unusually advanced, you may be asked to explain your code.
You are expected to use good design practices in the model, and you need to be able to describe and justify the design according to what is covered in class.
Part 4. The View
As indicated in Part 2, the view is simply the user interface, and its only purpose is to interact with the user and communicate with the model. It should not be storing or manipulating any of the data. It simply gets user requests and gets information from the model based on those requests.
There’s no denying that artificial intelligence is part of our lives and part of software development now. But it’s just a tool, and it is important for us to learn how to use that tool effectively. To that end, you are allowed (but not required) to use generative AI for this part of the code (and this part ONLY). You must document in the comments whenever you use code that was generated by AI. You will also need to include a description in the video of what the generated code does. Keep in mind that AI is just a tool and if used incorrectly can cause more problems than it solves. It is in your best interest to use it to build small, testable pieces of code rather than one large solution all at once. If something seems wrong, you can also ask it to explain itself, which can help identify the issues.
Part 5. Overall Functionality
The following describes the functionality required for this system.
By interacting with the UI, the user should be able to do all of the following:
search for information from the music store
● for a song by title
● for a song by artist
● for an album by title
● for an album by artist
the expected results of searching
● for a song that is in the database: print the song title, the artist, and the album it’s on
● for an album: print the album information and a list of the songs in the appropriate order
● for anything that is not in the database: a message indicating that the item is not there
● for anything that has multiple results: print all the results
search for information from the user library
● should cover all the search cases listed for the music store
● should also be able to search for a playlist by name – the result should print the songs (title and artist)
add something to the library
● add a song to the library (as long as it is in the store)
● add a whole album to the library (as long as it is in the store)
get a list of items from the library
● a list of song titles (any order)
● a list of artists (any order)
● a list of albums (any order)
● a list of playlists (any order)
● a list of “favorite” songs
create a playlist and add/remove songs
● playlists should have a name
● songs should be maintained in the order they are added
mark a song as “favorite”