PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: jgervin on May 21, 2009, 07:37:42



Title: ServiceLocator RemoteObjects?
Post by: jgervin on May 21, 2009, 07:37:42
So how would you implement a Cairngorm style servicelocator in Puremvc?

I am thinking you would have some sort of "Main" proxy, for instance, I have a stage mediator that listens to the stage for certain things so maybe a StageProxy would be the best location for this servicelocator or would I create some sort of ServicesUtil.as that the StageProxy would then use to its liking?


Title: Re: ServiceLocator RemoteObjects?
Post by: puremvc on May 22, 2009, 12:25:48
The idea of a StageProxy is a little whacky in an MVC sense. The Stage is a View tier entity, Proxies are Model tier entities.

If you wanted a ServiceLocator you could make one, but generally, we write the services directly into the Proxies that need them. The Proxies wrap the service and associated data. Essentially, the Model ends up being the ServiceLocator, because you retrieve the named Proxy from the service and make calls against it.

-=Cliff>


Title: Re: ServiceLocator RemoteObjects?
Post by: Gilbi on May 25, 2009, 10:21:01
I posted an example in the Utilities forum that uses ServiceLocator. It's janky junky though. Just use mx.rpc, your file size will be smaller also.