PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: tobydeh on March 07, 2008, 06:06:01



Title: stage logic in a proxy
Post by: tobydeh on March 07, 2008, 06:06:01
Hi Cliff,

David Knape did a presentation on PureMVC using a Gallery application he had built.

In this application he uses a Proxy to store Stage logic such as the Stage "resize" event along with the scale and align properties etc. I would have considered a StageMediator to be the correct place for this logic.

He also retrieves the Stage object from the Proxy and calls its update() method, I can't help but feel that he should have dispatched a STAGE_UPDATE notification instead of gaining reference to the Stage object?

What are your thoughts to his approach? Does the Stage need a Proxy?

Source is available here: http://bumpslide.com/blog/2008/01/16/puremvc_demo_src/


Title: Re: stage logic in a proxy
Post by: tobydeh on March 10, 2008, 02:37:55
*Bump*


Title: Re: stage logic in a proxy
Post by: puremvc on March 10, 2008, 10:33:47
Hi Toby,

I haven't looked through David's code, but what you are describing doesn't sound quite right.

I would suggest havig a look at the CodePeek AIR demo. There I'm now demostrating a utility called DesktopCitizen to persist and restore your window size, position, and maximized state.

Investigate the demo and the util and you'll see how I used a Proxy and a Mediator working together to pull it off. And how the model and view reponsibilities were divided.

-=Cliff>


Title: Re: stage logic in a proxy
Post by: tobydeh on March 10, 2008, 11:34:25
I understand where the responsibilities should be divided, I was just wondering what you thought about his approach!

Thanks anyway.