Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Places for animation  (Read 8354 times)
Parsons
Newbie
*
Posts: 2


View Profile Email
« on: December 11, 2008, 01:40:04 »

Hi everyone!

Let me introduce myself, for this is my first post: I'm quite experienced in AS2 and, on
an intermediate level, OOP. I am a newb to puremvc, yet I know the concept of MVC.
I'm developing an app where I need some very basic animations displaying underlying
information in different (changing) ways and different levels of granularity. I think it's
reasonable to use puremvc for this.

But, there is on point I'm particularly unsure about and just don't seem to find the answer.
Hopfully, you can help... To the point:

Where do I put animations? Literature (AS3 Design Patterns, O'Reilly, for example) tells me
the logic for an animation goes into the model, which updates the view. Now - in puremvc -
I am able to do the calculating in a proxy and send out a notification. But several times a second??
The balloonatroid-Example seems to pass a reference to the mc itself to the proxy which
in turn manipulates the mc directly - called on enterframe from the mediator. Another approach
I imagine having seen here is putting the logic of an animation into a command.
The first approach (updating the view) seems like the one with the loosest coupling, yet I
am concerned with CPU-time, sending notifications through the app so frequently. Which speaks
for an approach like balloonatroid - but do I really pass a ref to the mc itself as the dataObject
to the proxy? This feels odd to me...
An example: Suppose I have three mc's I want to fade in and out depending on which one is
the active one - now where do I put this animation, see above? And - do I use ONE proxy for
all three mc's (given the animation is in the proxy) or do I use three proxies, every one concerned
with just one view component? In a different approach I could just query a single proxy as to the
state of the model and then do the according animation in a command... ?!?!
Me so confused...

I hope these are not too many questions and that someone can give me directions in this!

Eyerybody have a good time!
Later,
P

Edit: Taking another look at Cliff Hall's HelloFlash Demo I find the animation code in the view
component itself... Am I taking the concept of mvc too seriously or am I missing something
obvious?
« Last Edit: December 11, 2008, 01:54:51 by Parsons » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: December 11, 2008, 06:54:07 »

Put the animation in the View. I hadn't looked at the latest Balloonatroid code, but the model shouldn't be involved.

The model is for domain data. Animation is specific to the view. HelloFlash is closer th what you're looking for.

-=Cliff>
Logged
Parsons
Newbie
*
Posts: 2


View Profile Email
« Reply #2 on: December 11, 2008, 07:43:50 »

Hey!

Now that's what I call a crisp answer, I will do just that - put the animation into
the view. Feels good to me. And quite logic, too hehe...

If I may add one more thought - I'm getting the impression that this sort of question
falls into the philosophical domain... I've heard/read at least 2 different opinions on the
general structure of mvc and the view/model differences in particular, both claiming
that this one is the only 'truth'... Or maybe... well whatever :P

Cliff - thanks for answering (personally), I appreciate that!
Best wishes.

Later,
P
Logged
Pages: [1]
Print