puremvc

PureMVC is not complicated

I've heard of quite a few people lately being turned off of PureMVC because it's "Needlessly complicated." I truly respect Cliff Hall and I love his creation, PureMVC, but the documentation for PureMVC is what's needlessly complicated, not PureMVC. As a community we need to step up and help Cliff advertise this wonderful framework better. So let's get one thing straight, PureMVC is not complicated. It's actually incredibly simple..

Using callLater in a PureMVC Mediator

This may seem obvious to most people but I needed to use calllater today in a mediator because its view component was not done initializing and I realized "callLater is a method of the flex framework, specifically the UIComponent, and the mediator, being an AS3 only class, doesn't have a callLater function! OH NO!"

Okay, so the solution is so simple. A mediator has a view it is responsible for, viewComponent... right? So just callLater on that.

PureMVC: SendNotification vs. NotifyObservers

PureMVC has two ways to dispatch a Notification. A "note" for short, is like a Flex Event but that's another story. So what's the difference? The main difference is that sendNotifiaction builds the note and sends it at the same time. It's arguments are the same as Notification.

PureMVC Argument

So me and the other people in my team got in a small argument over the proper use of PureMVC's mediators. We've read in various blogs that it is not a good practice to call a Proxy directly from a mediator. If you're going to call a proxy, it needs to be done from a command. In this particular case, we're asking for the proxy to refresh some data. That's it... one call. someProxy.refresh(). The refresh will send it's notification and our mediator will update.
Syndicate content