Design the class Diagram and database Schema for a system like Netflix with following Use Cases.
Netflix has users.
Every user has an email and a password.
Users can create profiles to have separate independent environments.
Each profile has a name and a type. Type can be KID or ADULT.
There are multiple videos on netflix.
For each video, there will be a title, description and a cast.
A cast is a list of actors who were a part of the video. For each actor we need to know their name and list of videos they were a part of.
For every video, for any profile who watched that video, we need to know the status (COMPLETED/ IN PROGRESS).
For every profile for whom a video is in progress, we want to know their last watch timestamp.
MY SOLUTION
NETFLIX
Class Diagram
classDiagram
direction TB
class User {
-String email
-String password
}
class Profile {
-User user
-String name
-ProfileType type
-Video[] videos
}
class ProfileType {
<<enumeration>>
ADULT
KID
}
class VideoStatus {
<<enumeration>>
COMPLETED
IN_PROGRESS
}
class Video {
-String title
-String descripiton
-Actor[] cast
}
class Actor {
-String name
}
class ProfileVideo {
Profile profile
Video video
VideoStatus status
DateTime timeStamp
}
User "1" *-- "*" Profile
Actor "*" o-- "*" Video
Video "*" o-- "*" Profile
Profile *-- ProfileVideo
Video *-- ProfileVideo
erDiagram
USER {
int id PK
String email
String passoword
}
PROFILE {
int id PK
String type
int user_id FK
}
ACTOR {
int id PK
String name
}
VIDEO {
int id PK
String title
String description
}
ACTOR_VIDEO {
int actor_id FK "Composite PK"
int video_id FK "Composite PK"
}
VIDEOSTATUS {
int id PK
String name
}
PROFILE_VIDEO {
int profile_id FK "Composte PK"
int video_id FK "Composite PK"
int video_status_id FK
DateTime timestamp
}
Take Home Exercise
Design the class Diagram and database Schema for a system like Netflix with following Use Cases.
MY SOLUTION
NETFLIX
Class Diagram