I'm a Flash developer migrating to Flex and Cairngorm. I want
have my Cairngorm ServiceLocator use AMF Remoting as the
but then fall back to a SOAP webservice if that fails. Both
have the same methods/operations as they are implemented in
I can define both the Remoting service and the webservice in
Services.mxml file in the usual way and can access both from
delegates and it all works fine.
Here's my problem: The Cairngorm examples I have seen all
the generic getService() method is depreciated and I should
getRemoteObject() or getWebService() from IServiceLocator.
that approach I could put the logic to decide which service
into each and every delegate but it would make more sense to
centralised in the Services.mxml file and have this serve up
currently used service to my delegate. Since they both
same methods, I should be able to call a generic services
using polymorphism and do some good OOP in the process.
So here's my question: How would you experienced Cairngorm
there approach this?
- Should I write a new method in my Services.mxml component,
switches between services by binding it to a variable
which service type to use in the ModelLocator? I'm not sure
it would be good
OOP to have the Servicelocator write to the ModelLocator
- Should I scrap the mxml version and extend ServiceLocator
- Should I abandon this bit of the Cairngorm framework swc
and write this from scratch?
- Any other suggestions/warnings? Has anyone done something