Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- 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
- the Track object to a PlaylistTrack into order to store that playlist_order value? Or am I designing this wrong?
- 09:50 < dyllan> thanks guys
- 09:50 < Naktibalda> shamess: your question was cut at "Or am I designin"
- 09:50 <@TML> shamess: sounds like Playlist is a collection of Tracks, to me
- 09:50 < shamess> *Or am I designing this wrong.
- 09:51 < shamess> (Didn't know there was a max lnegth in irc...)
- 09:51 -!- tqmz [~tqmz@lpzg-4d05922b.pool.mediaWays.net] has quit [Quit: lost in the k-hole ...]
- 09:51 -!- tqmz [~tqmz@lpzg-4d05922b.pool.mediaWays.net] has joined ##php
- 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
- instead.
- 09:51 -!- tqmz [~tqmz@lpzg-4d05922b.pool.mediaWays.net] has quit [Client Quit]
- 09:52 -!- tqmz [~tqmz@lpzg-4d05922b.pool.mediaWays.net] has joined ##php
- 09:52 < j0nr> Naktibalda: are you saying it is a server problem?
- 09:52 < Naktibalda> j0nr: no, somebody else told that
- 09:53 < Naktibalda> but of course it is a server problem
- 09:55 < Dashiad> shamess: It's a relation with properties.Thats a class in my opinion, but not derived from track.
- 09:55 -!- akamike [u5089@gateway/web/irccloud.com/x-sseypppxkfkmnill] has joined ##php
- 09:56 < nb-ben> why can't class Track contain this information to begin with
- 09:56 -!- abhinav_singh [~abhinav@122.172.185.171] has joined ##php
- 09:56 -!- Boulder [~Boulderpa@cpc5-wiga12-2-0-cust58.pres.cable.virginmedia.com] has joined ##php
- 09:56 < shamess> nb-ben: Because a Track can be in more than one Playlist.
- 09:57 < shamess> The Track class just gets data from the database table `track`.
- 09:57 < nb-ben> why is that a problem?
- 09:57 < nb-ben> and also
- 09:58 < nb-ben> you could make it so that tracks cannot be in multiple playlists
- 09:58 < Naktibalda> shamess: IMO you should have PlaylistItem, which has track as a property
- 09:58 < nb-ben> if that creates a problem
- 09:58 < nb-ben> but multiple tracks may refer to the same source
- 09:58 < nb-ben> (that is the sound file)
- 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.
- 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
- 09:59 -!- maestrojed [~maestroje@c-71-59-215-176.hsd1.or.comcast.net] has quit [Quit: Computer has gone to sleep.]
- 09:59 -!- gyzmodo [x@89.146.90.57] has quit [Read error: Connection reset by peer]
- 09:59 < nb-ben> I think you are over complicating something into too many classes
- 09:59 < shamess> nb-ben: I think you've confused me a little. How is it not the same track?
- 09:59 < nb-ben> that you don't actually need
- 09:59 -!- gyzmodo [x@89.146.90.57] has joined ##php
- 09:59 < nb-ben> Track != Song
- 10:00 < nb-ben> let's start with this in mind
- 10:00 < nb-ben> you only refer to a Track being a part of a play list
- 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.
- 10:00 < nb-ben> good
- 10:00 < shamess> Track is the only object which represents an audio file.
- 10:01 < nb-ben> Track also is not an audio file
- 10:01 < nb-ben> why not have Tracks contain all the information
- 10:01 < nb-ben> and point to whatever source audio file they do
- 10:01 < nb-ben> this way you end up with 2 classes
- 10:02 < nb-ben> maybe create an AudioFile class
- 10:03 < nb-ben> haven't slept for a long time, I may have shortages up there
- 10:03 -!- kanzie [~kanzie@84-55-97-12.customers.ownit.se] has quit [Quit: kanzie]
- 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
- should add, a Track object (which I'm suggesting should be called PlaylistTrack).
- 10:04 < shamess> And Track would handle playlist data and functionality.
- 10:04 < shamess> Yeah?
- 10:04 -!- abhinav_singh [~abhinav@122.172.185.171] has quit [Read error: Connection reset by peer]
- 10:05 < nb-ben> yes pretty much
Add Comment
Please, Sign In to add comment