Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
4 views14 pages

Group3 SoftwareArchitectureDocument

Uploaded by

hltbao21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views14 pages

Group3 SoftwareArchitectureDocument

Uploaded by

hltbao21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Group3

Melody Hub
Software Architecture Document

Version 1.0

[The texts in blue are guidance for filling in the information for each section. Remove everything in blue
when writing the document.

This template is a simplified version of the Software Architecture Document from the RUP model. ]
Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

Revision History
Date Version Description Author
17/11/2024 1.0 First edition description of classes Group3

Confidential ©Group3, 2024 Page 2 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

Table of Contents
1. Introduction
2. Architectural Goals and Constraints
3. Use-Case Model
4. Logical View
4.1 Component: User Management
4.2 Component: Authentication and Authorization
4.3 Component: Music management
4.3.1 Music Class
4.3.2 Album class
4.3.3 Music manager class
4.4 Component: Statistics and Analytics
4.5 Component: Community and Interaction
4.5.1 Listening hub class
4.5.2 Message class
4.5.3 Community manager class
4.6 Component: Playlist and Queue Management
4.7 Component: Search
4.8 Component: Music Player
4.9 Component: Download and Offline Management
5. Deployment
6. Implementation View

Confidential ©Group3, 2024 Page 3 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

Software Architecture Document


1. Introduction
[The introduction of the Software Architecture Document provides an overview of the entire Software
Architecture Document. It includes the purpose, scope, definitions, acronyms, abbreviations, references,
and overview of the Software Architecture Document.]
Purpose:
Outline the architecture design of the MelodyHub system.
Show a comprehensive guide for developers, architects, stakeholders to understand the system’s high-level
structure, designs, and how components interact with each other.
Help the developer and architect team visualize the system overview and implementation.
Scope:
This document covers the backend, frontend, and auxiliary components required to deliver a seamless
music streaming experience.

2. Architectural Goals and Constraints


[This section describes the software requirements and objectives that have some significant impact on the
architecture; for example, safety, security, privacy, use of an off-the-shelf product, portability, distribution,
and reuse. It also captures the special constraints that may apply: design and implementation strategy,
development tools, team structure, schedule, legacy code, and so on.
Vietnamese: Phần này nêu các mục tiêu và ràng buộc của kiến trúc phần mềm. Các mục tiêu và ràng buộc
này lấy từ yêu cầu phi chức năng trong tài liệu Vision. Ví dụ, các ràng buộc/mục tiêu như yêu cầu áp dụng
ngôn ngữ lập trình, môi trường của ứng dụng (như web, mobile, hay cả hai), ràng buộc về bảo mật, hiệu
năng, v.v…
Các bạn chỉ cần gạch đầu dòng các mục tiêu và ràng buộc quan trọng ở đây thôi.]
3. Use-Case Model
[This section includes the use case diagrams that are already modeled and presented in the use-case
specification document.]

4. Logical View
[This section describes the architecture with components and relationships among them. One or several
diagrams showing the architecture are provided here. For each component, describe its responsibilities
and/or services that are provided for other components. Each relationship should also indicate the means
of communication, such as HTTP, HTTPS, Socket, LAN, Internet, etc.
The detail of each component is provided using the subsection below.]
4.1 Component: User Management
[This section provides details for the component named “abc”. You need to include class diagrams for this
component and explain key classes.
For each component, create a section like this.]

Confidential ©Group3, 2024 Page 4 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

4.2 Component: Authentication and Authorization

4.3 Component: User management


4.3.1 User Class

Attributes:

● userID (String/UUID): Unique identifier for each user.


● username (String): Display name of the user.
● email (String): User's email address .
● password (String): Encrypted password .
● profilePicture (String): Path/URL to the profile picture .
● accountType (e.g., Artist, Listener) (Enum): Type of user .
● dateJoined (Date): Date the account was created .

Methods:
● login(): Authenticates user credentials and starts a session.
● logout(): Ends the user's session.
● updateProfile(updatedFields): Updates user profile attributes.
● viewProfile(): Displays user profile information.
● deleteAccount(): Deletes the user's account

4.3.2 Artist Class (Inherits from User)


Additional Attributes:
● bio (String): Artist biography .
● followers (Integer/List<User>): Number or list of followers.
● musicUploads (List<Music/Album>): List of songs or albums uploaded.
Additional Methods:
● uploadMusic(musicDetails): Uploads a new song/album.
● viewStatistics(songID): Retrieves performance metrics for a specific song.
● updateSongDetails(songID, updatedDetails): Edits metadata of an uploaded song.
● deleteSong(songID): Removes a song from the platform.
4.3.3 Listener Class (Inherits from User)
Additional Attributes:
● playlists (List<Playlist>): List of user-created playlists.
● likedSongs (List<Music>): List of liked songs.
Additional Methods:
● createPlaylist(name, isPublic): Creates a new playlist.
● addToPlaylist(playlistID, songID): Adds a song to a specific playlist.
● downloadMusic(songID): Downloads a song for offline listening.
● viewPlaylists(): Displays the list of created playlists

4.4 Component: Music player


4.4.1 MusicPlayer Class
Attributes:
● currentSong (Music object): The song currently playing .
● volume (Integer, range 0-100): Current volume level.
● playbackMode (Enum: NORMAL, REPEAT, SHUFFLE): Mode of playback.

Confidential ©Group3, 2024 Page 5 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

● isPlaying (Boolean): Playback state .


● queue (Queue object): List of songs in the playback queue .
● playbackTime (Integer): Current playback time in seconds .

Methods:

● play(): Starts playback of the current song.


● pause(): Pauses the current song.
● stop(): Stops playback and resets the playback time.
● next(): Skips to the next song in the queue.
● previous(): Goes back to the previous song (if available).
● setVolume(level): Adjusts the volume to the specified level.
● setPlaybackMode(mode): Sets playback mode (NORMAL, REPEAT, or SHUFFLE).
● seek(position): Jumps to a specific time in the current song.
● addToQueue(song): Adds a song to the end of the playback queue.
● removeFromQueue(songID): Removes a song from the queue.
● shuffleQueue(): Shuffles the playback queue.

Confidential ©Group3, 2024 Page 6 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

4.5 Component: Music management

4.5.1 Music Class


Represents an individual song in the system, encapsulating all song-specific details.
Attributes:
● songID (string): A unique identifier for the song, ensuring that each track can be referenced distinctly.
● title (string): The name of the song.
● lyrics (string): The lyrics of the song.
● genre (string): The genre of the song (e.g., pop, rock, jazz).

Confidential ©Group3, 2024 Page 7 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

● duration (int): The length of the song in seconds.


● isPublic(bool): Whether listeners are able to view the song
● likes (long long): A count of how many users have liked this song.
● dislikes (long long): A count of how many users have disliked this song.
● downloads (long long): A count of how many users have downloaded the song
● playCount (long long): The total number of times the song has been played.
Methods:
● increasePlayCount(): Increases the playCount when the song is played.
● increaseDownload(): Increases the downloads when the song is downloaded.
● like(): Adds a like to the song and updates the likes property.
● unlike(): Removes a like from the song and updates the likes property.
● dislike(): Adds a dislike to the song and updates the dislikes property.
● undislike(): Removes a dislike from the song and updates the dislikes property.
● update (updates: dict): Updates the song properties based on the provided updates.

4.5.2 Album class


Represents a collection of songs grouped into an album, typically by the same artist.
Attributes:
● albumID (string): A unique identifier for the album.
● title (string): The name of the album.
● releaseDate (date): The date the album was released.
● isPublic(bool): Whether listeners are able to view the album
● songs (list of Music): A collection of Music instances that belong to this album.
Methods:
● addSong(song: Music): Adds a song to the album's songs list.
● removeSong(songID: string): Removes a song from the album using its songID.
● getTotalDuration(): Calculates and returns the total duration of all songs in the album.
● listSongs(): Returns a list of all the songs in the album, including their details.
● update (updates: dict): Updates the album properties based on the provided updates.

4.5.3 Music manager class


Manages the overall music database, handling the lifecycle of music and album entities.
Attributes:
● musicCollection (list of Music): A centralized collection of all songs managed by the system.
● albumCollection (list of Album): A centralized collection of all albums managed by the system.
Methods:
● addMusic(music: Music):
○ Adds a new song to the musicCollection.
○ Ensures that the songID is unique and does not conflict with existing songs.
● updateMusic(songID: string, updates: dict): Updates properties of a song in the musicCollection based
on the songID and the provided updates
● deleteMusic(songID: string): Removes a song from the musicCollection using its songID.
● getMusic(songID: string): Retrieves a song from the musicCollection using its songID.
● addAlbum(album: Album):
○ Adds a new album to the albumCollection.
○ Validates that all songs in the album are already present in the musicCollection.
● updateAlbum(albumID: string, updates: dict): Updates properties of an album in the albumCollection
based on the albumID and the provided updates
● deleteAlbum(songID: string): Removes an album from the albumCollection using its albumID.
● getAlbum(albumID: string): Retrieves an album from the albumCollection using its albumID.
● searchMusic(query: string): Searches the musicCollection for songs matching the query.
● searchAlbum(query: string): Searches the albumCollection for albums matching the query.

Confidential ©Group3, 2024 Page 8 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

4.6 Component: Statistics and Analytics

4.6.1 Statistic class


Represent a statistic of a single song, useful for artists to track the metrics.
Attributes:
● contentID (int): An unique identifier of song’s statistics.
● views (int): The number of views the song has.
● likes (int): The number of likes the song has received.
● comments (int): The number of comments on the song
● downloads (int): The number of downloads for the song
● average_time_played (float): The average time listeners spend playing the song
● completion_rate (float): The rate at which listeners complete the song.
● total_playlist_addition (int): The number of times the song has been added to the playlists
Methods:
● incrementView(): Increases the view count by 1
● addLike(): Increases the like count by 1
● calculateCompletionRate(totalPlays: int, completePlays: int): Calculates the completion rate based on
total plays vs completed plays
● addComment(comment: string, userID: int): Adds a new comment with the provided text and user ID
● getComment(): Returns the comments
● incrementDownloads(): Increases the download count by 1
● updateAverageTimePlayed(newPlayTime: float): Updates the average time played
● getView(): Returns the view count
● getLike(): Returns the like count
● getDownloads(): Returns the download count
● getAverageTimePlayed(): Returns the average time played
● getCompletionRate(): Returns the completion rate
4.6.2 Statistics Manager Class
Manages and provides access to statistics of a song.
Attributes:
● statisticsCollection (List<Statistic>): A list containing all the statistics of a song
Methods:

Confidential ©Group3, 2024 Page 9 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

● fetchStatistics(contentID: string): Retrieves the Statistic object with the given contentID.
● updateStatistics(contentID: string, updates: Map<String, object>): Updates the properties of the
Statistic object with the given contentID.
● generateReport(contentID: string): Generates a report for the Statistic object with the given contentID.
● getTopContentByViews(limit: int): Returns a list of the top Statistic objects sorted by view count, up to
the given limit.
● getTopContentByLikes(limit: int): Returns a list of the top Statistic objects sorted by like count, up to the
given limit.
● getTopContentByComments(limit: int): Returns a list of the top Statistic objects sorted by comment
count, up to the given limit.
● getTopContentByDownloads(limit: int): Returns a list of the top Statistic objects sorted by download
count, up to the given limit.
● getTopContentByAverageTime(limit: int): Returns a list of the top Statistic objects sorted by average
time played, up to the given limit.
4.7 Component: Community and Interaction

4.7.1 Listening hub class


Represents a virtual space where users gather to listen to music and interact
Attributes:

Confidential ©Group3, 2024 Page 10 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

● hubID (string): A unique identifier for the listening hub.


● name (string): The name of the listening hub, often set by its creator.
● participants (list of User): A list of users currently in the hub.
● musicQueue (Queue): A queue of Music objects that the participants are collectively listening to.
● messages (list of Message): A collection of Message objects representing the chat history of the hub.
Methods:
● addParticipant(user: User): Adds a user to the participants list.
● removeParticipant(userID: string): Removes a user from the participants list by their unique identifier.
● addSongToQ(song: Music): Adds a Music object to the musicQueue.
● removeSongFromQ(songID: string): Removes a song from the musicQueue by its unique identifier.
● addMessage(message: Message): Adds a Message object to the messages list.
● clearMessages(): Clears the chat history of the hub.

4.7.2 Message class


Represents a single message sent by a participant in the listening hub
Attributes:
● messageID (string): A unique identifier for the message.
● content (string): The text content of the message.
● timestamp (datetime): The date and time when the message was sent.
● sender (User): The user who sent the message.
Methods:
● formatMessage(): Formats the message for display, combining the timestamp, sender, and content.
● validateContent(): Ensures that the message content meets guidelines (e.g., no offensive language).

4.7.3 Community manager class


Handles the management and functionality of community hubs, including participant interactions and hub lifecycle
management.
Attributes:
● listeningHubs (list of ListeningHub): A collection of all active listening hubs.
Methods:
● createHub(name: string, creator: User): Creates a new ListeningHub, assigns it a unique hubID, and
adds the creator to the participants list.
● deleteHub(hubID: string): Deletes a hub from the listeningHubs collection and clears its data.
● addParticipant(hubID: string, user: User): Adds a user to the participants list of the specified hub.
● removeParticipant(hubID: string, userID: string): Removes a user from the participants list of the
specified hub.
● addSongToHubQ(hubID: string, song: Music): Adds a Music object to the queue of the specified hub.
● removeSongFromHubQ(hubID: string, songID: string): Removes a song from the queue of the
specified hub.
● postMessage(hubID: string, message: Message): Adds a new Message object to the messages list of the
specified hub.
● deleteMessage(hubID: string, messageID: string): Deletes a specific message from a hub’s chat history.
● clearHubMessages(hubID: string): Clears the chat history for a specified hub.
● getHubByID(hubID: string): Retrieves a ListeningHub object by its hubID.
● listAllHubs(): Returns a list of all active hubs with basic information (e.g., name, number of participants).

Confidential ©Group3, 2024 Page 11 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

4.8 Component: Playlist and Queue Management

4.8.1 PlaylistManager class


Represents the manager responsible for creating, organizing, and sharing playlists.
Attributes:
● playlists (List<Playlist>): A collection of playlists managed by the PlaylistManager.
Methods:
● createPlaylist(name: string, isPublic: boolean): Playlist : Creates a new playlist with the specified name
and visibility status.
● deletePlaylist(playlist: Playlist): void : Deletes a specified playlist from the manager's collection.
● addMusicToPlaylist(playlist: Playlist, song: Music): void : Adds a song to a specified playlist.
● sharePlaylist(playlist: Playlist): void : Share a specified playlist with other users or platforms.
4.8.2 Playlist class
Represents a music playlist that contains a collection of songs and metadata about the playlist.
Attributes:
● playlistID (string): A unique identifier for the playlist.
● name (string): The name of the playlist.

Confidential ©Group3, 2024 Page 12 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

● isPublic (boolean): Indicates whether the playlist is publicly visible or private.


● songs (List<Music>): A list of songs included in the playlist.
Methods:
● addSong(song: Music): void : Adds a song to the playlist.
● removeSong(song: Music): void : Removes a specified song from the playlist.
● editName(newName: string): void : Changes the playlist's name to the specified new name.
● toggleVisibility(): void : Toggles the visibility of the playlist between public and private.
● playPlaylist(): Queue : Creates a queue object consisting of songs from the playlist and returns it.
4.8.3 Queue Class
Represents a queue of songs to be played, allowing operations like adding, skipping, or shuffling songs.
Attributes:
● queueID (string): A unique identifier for the queue.
● songs (List<Music>): A collection of songs currently in the queue.
Methods:
● addToQueue(song: Music): void : Adds a song to the end of the queue.
● removeFromQueue(song: Music): void : Removes a specified song from the queue.
● skip(): Music : Skips the current song and returns the next song in the queue.
● shuffle(): void : Randomizes the order of the songs in the queue.
4.9 Component: Search

4.9.1 Search Result Class


Represents a result of a search query.
Attributes:
● id (string): The unique identifier for the search result
● title (string): The title of the search result
● type (string): The type of the search result
● metadata (Map<string, string>): Additional metadata about the search result
Methods:
● getDetails(): Returns a Map<string, string> with additional details about the search result
4.9.2 Search Manager Class
Manages the search functionality.
Attributes:
● query (string): The search query
● results (List<SearchResult>): The list of search results
Methods:
● performSearch(query: string): Performs a search using the provided query and updates the results
● filterResult(filters: Map<string, string>): Filters the search results based on the provided filters
● sortResult(sortBy: string): Sorts the search results based on the provided sort criteria
4.10 Component: Music Player

Confidential ©Group3, 2024 Page 13 of 14


Melody Hub Version: 1.0
Software Architecture Document Date: 17/11/2024
001

4.11 Component: Download and Offline Management

4.11.1 DownloadManager class


Represents a manager responsible for handling the download of songs.
Attributes:
● downloadID (string): A unique identifier for each download session.
● downloadStatus (string): Indicates the current status of the download (e.g., "In Progress", "Completed",
"Failed").
● filePath (string): The location where the downloaded song will be stored on the user's device.
Methods:
● downloadSong(song: Music): void : Initiates the download of the specified song and saves it to the
designated file path.
5. Deployment
[Leave this section blank for PA3 .if you are writing this document for PA4.
In this section, describe how the system is deployed by mapping the components in Section 4 to machines
running them. For example, your mobile app is running on a mobile device (Android, iOS, etc), your server
runs all components on the server side including the database]
6. Implementation View
[Leave this section blank for PA3 if you are writing this document for PA4.
In this section, provide folder structures for your code for all components described in Section 4. ]

Confidential ©Group3, 2024 Page 14 of 14

You might also like