PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: 2morrowMan on August 27, 2010, 08:30:46



Title: Proxy and data from multiple sources
Post by: 2morrowMan on August 27, 2010, 08:30:46
Hello Cliff.
In my social app I have one mediator and component thats displays users ratings. Data for this mediator loads from different sources. First loads data from my site(users ids, rating, type, etc) and then loads data from social network site (user name, photo, etc) base on data loaded previously.
Question is what is the best way:
1) Use one Proxy (UserRatingProxy) to load data from both sources, group it in collection and then send notification to mediator?
2) Use two proxy (for example UserDataProxy and UserProfilesProxy). Use mediator to initiate sequential loading with commands and data from first proxy, wait for data, group it and display?

Thanks.


Title: Re: Proxy and data from multiple sources
Post by: puremvc on August 30, 2010, 05:08:22
I believe I'd go with option 1. It will be a slightly more complex Proxy, but less complexity in the app trying to manage the sequencing. Of course you could probably use the Loadup utility to manage this as well. See the LoadupAsOrdered demo.

-=Cliff>


Title: Re: Proxy and data from multiple sources
Post by: 2morrowMan on August 31, 2010, 08:42:26
Thank you! :)