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: should proxy share notifications?  (Read 5498 times)
gregbown
Jr. Member
**
Posts: 16


View Profile Email
« on: February 14, 2009, 08:47:32 »

I have an application that allows customers to preview media, login purchase and and view full library.
Init proxy returns the preview and price only. Login and buy proxy returns the complete library.
There was a request for maintaining the logged in state if a user returns to the page. I now check for a stored session id in a shared object in my init proxy. If it exists I post it to my API and get the complete library back.
My Question
Should I handle the new post structure in init proxy or communicate the session to a application mediator and then handle it in the login proxy.
My other finding.??? I can send the login proxy notification to my application mediator from the init proxy and application mediator handles it as if it came from login proxy and I don't need to write any additional code to handle the response because the structure is already there to handle it ...
Weird.  I guess the proxy's are in the same package so if the sendNotification is public that would explain it
« Last Edit: February 23, 2009, 07:02:09 by gregbown » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: February 24, 2009, 06:01:20 »

It doesn't matter where a notification comes from, any interested mediator will handle it.

As for handling the automatic login, it would be best to have a command that invokes the LoginProxy's login method. Then send the same notification to trigger that command from either your mediator that is listening to your login view component OR from your code that has just pulled the login info from the local shared object.

Here, again the notification can come from different places but still trigger the same command.

-=Cliff>
Logged
Pages: [1]
Print