Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Class Diagram

Fig: Class diagram


User Class:

The User class represents a user of the music streaming web application.
It has the following attributes:
1. username: Stores the username of the user.
2. password: Stores the password of the user.
3. playlists: An array of Playlist objects representing the playlists created by
the user.
4. favorites: An array of Song objects representing the songs that the user has
marked as favorites.
5. profile: An instance of the Profile class representing the user's profile
information.
It provides the following methods:
1. register(): Allows the user to register an account.
2. login(): Authenticates the user during the login process.
3. makePlaylist(): Creates a new playlist.
4. hearSong(): Plays a selected song.
5. addToFavorite(): Adds a song to the user's favorites list.

Playlist Class:
The Playlist class represents a playlist created by a user.
It has the following attributes:
1. name: Stores the name of the playlist.
2. songs: An array of Song objects representing the songs included in the
playlist.

Profile Class:
The Profile class represents the user's profile information.
It has the following attributes:
1. firstName: Stores the first name of the user.
2. lastName: Stores the last name of the user.
3. email: Stores the email address of the user.

Song Class:
The Song class represents a song in the music streaming application.
It has the following attributes:
1. title: Stores the title of the song.
2. artist: Stores the name of the artist or band associated with the song.
3. genre: Stores the genre of the song.

Classification Class:
The Classification class represents the classification of a song into a specific genre.
It has the following attributes:
1. song: An instance of the Song class representing the classified song.
2. genre: Stores the genre assigned to the song.

This class diagram illustrates the relationships and attributes of the classes
involved in a music streaming web application. The User class manages user-
related functionalities such as registration, login, playlist creation, and marking
songs as favorites. The Profile class stores the user's personal information. The
Song class represents individual songs in the application, including details like
title, artist, and genre. The Classification class is responsible for assigning genres
to songs. The Playlist class is used to organize songs into user-created playlists.

You might also like