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.
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.