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: Passing a service URL or loaded XML to a Proxy  (Read 7701 times)
Allen
Newbie
*
Posts: 5


View Profile Email
« 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.



Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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> 
Logged
Pages: [1]
Print