RFC on playlist redesign

Ian Monroe ian at monroe.nu
Mon Apr 9 15:50:07 CEST 2007


On 4/9/07, Maximilian Kossick <mkossick at gmx.de> wrote:
> This looks like the perfect use case for the GoF strategy pattern.

I actually didn't know what that was so I got the GoF book and looked
it up. It appears that it already is the strategy pattern, with the
(sort of) exception that the object asking it to perform is strategy
is the EngineObservor and not the class with the data to be
manipulated (the PlaylistModel).

> While
> putting all the random modes in one class might be faster to implement, we
> should try very hard to avoid the if-else hell that Playlist::playNextTrack
> is now.
>
> And StandardMode could be just an implementation of the strategy which isn't
> very random.

I agree with you here. I'll break up RandomMode if it turns into a
bunch of confusing if's.

Regardless I want to have a StandardMode just to have something to
start off with.


More information about the Amarok-devel mailing list