Models - kristinedomingo/cs373-idb GitHub Wiki

UML

UML

##Synopsis This is the model section. This section describes the models use for the database on SWEetMusic. There is three models on the Unified Modeling Language(UML) which are Artist, Album, Track. The UML has 2 many to many relationship and one to many relationship. The first many to many relationship is between Artist and Albums because an Album can be release by many Artist and Artist can release many Albums. The second many to many relationship is between Artist and Tracks because an Artist can sing many Tracks and Tracks can be song by many Artist. The last relationship would be the one to many relationship between Album and Tracks because an Album could contain many Tracks but a Track could only be in one Album.

Three pillars of information:

  1. Artist: Contains information about the Artist: name, number of albums, recent album, etc
  2. Album: Contains information about the Album: name, date it was released, etc
  3. Track: Contains information about the Track: title, artist name, etc

Attributes of the Models

Artist

  • name: It gives a string of the name of the Artist
  • num_albums: Returns an Integer of the number of Albums that specific Artist has made
  • recent_album: Returns a String of the current album that Artist has release
  • top_tracks: Returns a String of the number one hit track the artist has.
  • popularity: Returns an Integer of the awesomeness of the Artist based on Spotify ranking
  • spotify_uri: Returns a String of the Spotify Uri that can be use to get more information about the Artist of the Spotify API
  • spotify_id: Returns a String id of the Spotify Id which is used to connect and route the front-page
  • col_img: Returns String Url of the images in used in for each Artist
  • images Returns String Url of the image used inside Artist Details page
  • href Returns String in order to look up the Track or Artist or Album easily

Album

  • name: A string name of the Album
  • date: A date object of the date created by Album
  • length: An Integer of the length of the Album usually in milliseconds
  • num_tracks: An integer that shows the number of Tracks in the Album
  • artists: A String identifying who wrote the Album
  • spotify_uri: A String of the Spotify Uri that can be use to get more information about the Album of the Spotify API
  • spotify_id: Returns a String id of the Spotify Id which is used to connect and route the front-page
  • images Returns String Url of the image used inside Album Details page
  • col_img: Returns String Url of the images in used in for each Album
  • href: Returns String in order to look up the Track or Artist or Album easily

Track

  • title: A String The name of the Track
  • artist_name: A String of the Artist who wrote the Track
  • release_date: A Date-object that give the Date of the creation of the Track
  • album: A String of the Album the Track is in
  • album_cover_url: A String URL that has the Album image
  • duration: An Integer of how long the song is in milliseconds
  • spotify_uri: A String of the Spotify Uri that can be use to get more information about the Track of the Spotify API
  • spotify_id: Returns a String id of the Spotify Id which is used to connect and route the front-page
  • col_img: Returns String Url of the images in used in for each Track
  • h_ref: Returns String in order to look up the Track or Artist or Album easily
  • album_id: Returns a foreign key of the album_id returns null if it doesn't exist.