views:

12

answers:

2

I have a Flex 4 client application that is under development in parallel with the server back-end. I am use Mate's MockRemoteObject to provide a mock data service, but as the real data service comes on line, we'll want to run against that sometimes from Eclipse.

Is there a way to easily switch between the two without having to modify source code?

Based on my research it seems like Spring-Actionscript might work, but I really do not want to switch frameworks at this point if I don't have to.

A: 

What about to build some proxy or localhost server and during mocking run it on your machine.

In another words, just make your mockUp URL exactly like an external production server. If you are working in a team, make a VPN network btw.

Eugene
A: 

I found a way to do it. They key was using the little known feature of Actionscript called conditional compilation. By setting a compile time flag, I was able to include the mock data source code and use the mock service objects instead of the real ones. Whenever I compile without the flag, all of the mock source code is excluded from the project because it is on a non-standard Maven build path.

HDave