Guest User

Untitled

a guest
Jun 17th, 2018
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.51 KB | None | 0 0
  1. 09:50 < shamess> Wondering if you could help with a design (rather than code) question! My system has Tracks, which can appear in a Playlist multiple times. However, each track in
  2. the playlist will have a unique place in the playlist. (Track id 34 can appear in a playlist twice, but at position 3 and then later at position 8.) Should I extend
  3. the Track object to a PlaylistTrack into order to store that playlist_order value? Or am I designing this wrong?
  4. 09:50 < dyllan> thanks guys
  5. 09:50 < Naktibalda> shamess: your question was cut at "Or am I designin"
  6. 09:50 <@TML> shamess: sounds like Playlist is a collection of Tracks, to me
  7. 09:50 < shamess> *Or am I designing this wrong.
  8. 09:51 < shamess> (Didn't know there was a max lnegth in irc...)
  9. 09:51 -!- tqmz [~tqmz@lpzg-4d05922b.pool.mediaWays.net] has quit [Quit: lost in the k-hole ...]
  10. 09:51 -!- tqmz [~tqmz@lpzg-4d05922b.pool.mediaWays.net] has joined ##php
  11. 09:51 < shamess> TML: yeah, it is. But if the Track will need extra information when it's apart of a Playlist. So I want thinking a Playlist should be a collection of PlaylistTracks
  12. instead.
  13. 09:51 -!- tqmz [~tqmz@lpzg-4d05922b.pool.mediaWays.net] has quit [Client Quit]
  14. 09:52 -!- tqmz [~tqmz@lpzg-4d05922b.pool.mediaWays.net] has joined ##php
  15. 09:52 < j0nr> Naktibalda: are you saying it is a server problem?
  16. 09:52 < Naktibalda> j0nr: no, somebody else told that
  17. 09:53 < Naktibalda> but of course it is a server problem
  18. 09:55 < Dashiad> shamess: It's a relation with properties.Thats a class in my opinion, but not derived from track.
  19. 09:55 -!- akamike [u5089@gateway/web/irccloud.com/x-sseypppxkfkmnill] has joined ##php
  20. 09:56 < nb-ben> why can't class Track contain this information to begin with
  21. 09:56 -!- abhinav_singh [~abhinav@122.172.185.171] has joined ##php
  22. 09:56 -!- Boulder [~Boulderpa@cpc5-wiga12-2-0-cust58.pres.cable.virginmedia.com] has joined ##php
  23. 09:56 < shamess> nb-ben: Because a Track can be in more than one Playlist.
  24. 09:57 < shamess> The Track class just gets data from the database table `track`.
  25. 09:57 < nb-ben> why is that a problem?
  26. 09:57 < nb-ben> and also
  27. 09:58 < nb-ben> you could make it so that tracks cannot be in multiple playlists
  28. 09:58 < Naktibalda> shamess: IMO you should have PlaylistItem, which has track as a property
  29. 09:58 < nb-ben> if that creates a problem
  30. 09:58 < nb-ben> but multiple tracks may refer to the same source
  31. 09:58 < nb-ben> (that is the sound file)
  32. 09:58 < shamess> Naktibalda: Yeah, that was my idea too, but I was calling it PlaylistTrack. It would hold all Track, plus it's place in the playlist.
  33. 09:59 < nb-ben> because in reality, a track is a part of a playlist, and even if it's the same song on multiple playlists, it's not the same track
  34. 09:59 -!- maestrojed [~maestroje@c-71-59-215-176.hsd1.or.comcast.net] has quit [Quit: Computer has gone to sleep.]
  35. 09:59 -!- gyzmodo [x@89.146.90.57] has quit [Read error: Connection reset by peer]
  36. 09:59 < nb-ben> I think you are over complicating something into too many classes
  37. 09:59 < shamess> nb-ben: I think you've confused me a little. How is it not the same track?
  38. 09:59 < nb-ben> that you don't actually need
  39. 09:59 -!- gyzmodo [x@89.146.90.57] has joined ##php
  40. 09:59 < nb-ben> Track != Song
  41. 10:00 < nb-ben> let's start with this in mind
  42. 10:00 < nb-ben> you only refer to a Track being a part of a play list
  43. 10:00 < shamess> nb-ben: Oh! I see. I've fundamentally start with song and track being the same thing. There's only the Track object, not Song.
  44. 10:00 < nb-ben> good
  45. 10:00 < shamess> Track is the only object which represents an audio file.
  46. 10:01 < nb-ben> Track also is not an audio file
  47. 10:01 < nb-ben> why not have Tracks contain all the information
  48. 10:01 < nb-ben> and point to whatever source audio file they do
  49. 10:01 < nb-ben> this way you end up with 2 classes
  50. 10:02 < nb-ben> maybe create an AudioFile class
  51. 10:03 < nb-ben> haven't slept for a long time, I may have shortages up there
  52. 10:03 -!- kanzie [~kanzie@84-55-97-12.customers.ownit.se] has quit [Quit: kanzie]
  53. 10:03 < shamess> yeah, I think ultimately we're getting to the same conclusion. I already have AudioFile (I jsut call it track) and I'm missing, which I think you're suggesting I
  54. should add, a Track object (which I'm suggesting should be called PlaylistTrack).
  55. 10:04 < shamess> And Track would handle playlist data and functionality.
  56. 10:04 < shamess> Yeah?
  57. 10:04 -!- abhinav_singh [~abhinav@122.172.185.171] has quit [Read error: Connection reset by peer]
  58. 10:05 < nb-ben> yes pretty much
Add Comment
Please, Sign In to add comment