PureMVC Architects Lounge

Announcements and General Discussion => Getting Started => Topic started by: Allen on September 11, 2008, 05:18:18



Title: Passing a service URL or loaded XML to a Proxy
Post by: Allen on September 11, 2008, 05:18:18
I have seen that in some examples, a service's  Url is passed into a proxy at runtime once it has been aquired (say from a Config class). I have also seen some examples where XML is loaded and then passed into a proxy at runtime.

It seems that really, a Proxy should not reveal its inner workings to the app - If the app needs to know where the proxy is getting the data from, it is failing to do its job as a Proxy. Surely the Proxy should offer only an API to get the data and should be resposible for loading its own data.





Title: Re: Passing a service URL or loaded XML to a Proxy
Post by: puremvc on September 11, 2008, 06:21:11
Usually you want to put the URLs into a config file so that you can change them without having to recompile the app. This makes the Proxy more reusable.

Consider an RSS Feed Proxy. It could read any feed and be maximally reusable if you pass it the URL. But if you hard code the URL in the Proxy, it will only work for that one feed.

-=Cliff>