views:

24

answers:

1

Animations are a strange mix of view and control, and they sometimes need to be synchronized with delays between them, callback to code, etc.

So, without being specific to any particular GUI framework, where should I put my animation code in a MVC architecture?

A: 

This is such a general question, but I would be inclined to put this completely in the view if possible. You could think of it like jQuery animations which have a final value and a duration - you could think of this being handed off to the view, which could take care of everything at that point.

Justin Ethier
Yes, I know this is a general question, actually I think it should be a wiki. I wants to gather inputs on how other people are organizing their code to deal with animations. That said, I think you're right about putting the actual animation (modification of value over time) in the view. However, some animations are parts of a bigger animation which might affect other views, or are parts of a 'task' which require some logic, ex: a preloader animation is shown while the the data is loading. How do you deal with that?
Subb
I agree with Justin - it belongs in the view. Sure it might have dependencies within the same layer (View) - that's ok, welcome to the world of OO :)
Adrian K