On 1/23/17, 11:49 PM, "Harbs" <harbs.li...@gmail.com> wrote:
>The question is how far to take this. > >Should every method in Effect be a separate interface? i.e. IPlayable, >IReversable, IPausable, IStoppable, IResumable. That seems a bit >over-the-top to me. > >As IEffect currently stands, Parallel needs the methods implemented. > >Personally, I think Parallel should probably extend CompoundEffect which >should implement reverse() stop() pause() and resume(). The only method >which seems to be specific to Parallel as opposed to Sequence is play(). > >These seem to all be pretty standard functionality to Effects. I'm not an expert on effects, but for reverse(), I was wondering if there are ever more than one reverse() implementation. For example, if the effect is a person walking left to right and slowing down towards the end, a simple reverse() would cause the person to walk backwards slowly at first and then faster as the person returns to the left, but do any implementations cause the person to turn around? Or have the person slowing down towards as the person returns to the left? That's why I suggested that these methods be implemented as beads, so there can be various implementations. That said, it may not be worth getting too granular. IMO, the 80% case is folks play an effect forward and never stop, pause, reverse or resume. But once you need to pause you probably need to resume(). But it also doesn't really matter right now. I think the Basic package should have a "play-only" Parallel and if you need reverse() add that to another class and fill out whatever else you have time for. Someone else can always do the other permutations. I don't really have a problem with Parallel not implementing every method in IEffect as long as we document that. -Alex