DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Experiment 1.4
Student Name: Ravina UID: 23BCS12881
Branch: CSE Section/Group: 801- A
Semester: 6th Date of Performance:3/2/26
Subject Name: System Design Subject Code: 23CSH-314
1. Aim: To design and implement a Low-Level Design (LLD) for a Music Streaming
Service using UML modeling, OOP concepts, SOLID principles, and design patterns
(Singleton, Factory Method, Observer, Strategy) to support core features while considering
performance aspects.
2. Objective:
Create a UML class diagram for a music streaming service.
Implement the design in Java using OOP, SOLID, and design patterns.
Include features like playback, playlists, artist following, and recommendations.
3. Procedure:
Create UML Diagram
Define core classes and relationships.
Add visual elements for Singleton, Factory, Strategy, and Observer.
Apply SOLID
Use interfaces/abstract classes.
Keep classes single-purpose and extensible.
Implement Patterns
Singleton for AudioEngine.
Factory for recommendation engines.
Strategy for playback modes.
Observer for artist notifications.
Code Implementation
Write Java classes and core features.
Include basic performance considerations.
Testing
Create test scenarios.
Validate pattern behavior and performance.
4. PlantUML code:
@startuml
AudioEngine ..> Track
skinparam classAttributeIconSize 0 '========================
skinparam backgroundColor #F8F9FA ' Factory Pattern
skinparam roundCorner 15 '========================
skinparam class { interface RecommendationEngine <<factory>>
BackgroundColor<<core>> #FFE5B4 {
BorderColor<<core>> #FF8C00 +recommend(user: StreamingUser):
BackgroundColor<<singleton>> #B4E7FF List<Track>
BorderColor<<singleton>> #0066CC }
BackgroundColor<<factory>> #D4F4DD
BorderColor<<factory>> #2D8659 class TrendingEngine <<factory>>
BackgroundColor<<strategy>> #FFD4E5 class PersonalizedEngine <<factory>>
BorderColor<<strategy>> #CC0066 RecommendationEngine <|.. TrendingEngine
BackgroundColor<<observer>> #E5D4FF RecommendationEngine <|.. PersonalizedEngine
BorderColor<<observer>> #6600CC
} abstract class EngineFactory <<factory>> {
+{abstract} create(): RecommendationEngine
title Music Streaming Platform - Design Patterns }
class StreamingUser <<core>> { class TrendingFactory <<factory>>
-userId: String class PersonalizedFactory <<factory>>
+playTrack(track: Track) EngineFactory <|-- TrendingFactory
+buildPlaylist(): MusicPlaylist EngineFactory <|-- PersonalizedFactory
}
interface PlaybackMode <<strategy>> {
class Track <<core>> { +execute(track: Track)
-trackId: String }
-trackName: String class SequentialPlay <<strategy>>
-duration: int class ShufflePlay <<strategy>>
} class RepeatPlay <<strategy>>
PlaybackMode <|.. SequentialPlay
class MusicArtist <<core>> { PlaybackMode <|.. ShufflePlay
-artistId: String PlaybackMode <|.. RepeatPlay
-artistName: String
+releaseTrack(track: Track) interface Subscriber <<observer>> {
} +update(track: Track)
}
class MusicPlaylist <<core>> { interface Publisher <<observer>> {
-playlistId: String +notify(track: Track)
+insertTrack(track: Track) }
} MusicArtist ..|> Publisher
StreamingUser ..|> Subscriber
StreamingUser "1" -- "*" MusicPlaylist Publisher ..> Subscriber
MusicPlaylist "*" o-- "*" Track
MusicArtist "1" -- "*" Track note top of MusicArtist
StreamingUser "*" -- "*" MusicArtist Artists: A.R. Rahman, Arijit Singh,
Shreya Ghoshal
class AudioEngine <<singleton>> { end note
-{static} instance: AudioEngine
note top of Track
-AudioEngine() Tracks: "Jai Ho", "Tum Hi Ho",
+{static} getInstance(): AudioEngine , "Lag Ja Gale"
+playTrack(track: Track) end note
}
@enduml
5. Output:
6. Learning Outcome:
Understand how to design a UML diagram with patterns.
Apply SOLID principles in system architecture.
Write clean, extensible, and efficient code.
Build features like playback, playlists, and recommendations.