2

In a Flex / Java app stack using remoting (via BlazeDS), classes to hold data passed back and forth between client and server need to be maintained in both the client (in ActionScript) and server (in Java).

I want a way to maintain theses classes in Java only, and have the corresponding ActionScript value object classes generated by the build process.

4 Answers 4

2

Check out the AS3 generator from the Granite Data Services project:

http://www.graniteds.org

If I recall correctly it's an Eclipse plugin which should be quite easy to use. Just remember that if you exclude a property from the ActionScript class that it will still be serialized by Blaze when it's sent back to the Flex client.

0

XDoclet2 includes an ActionScript plugin that can generate ActionScript classes from Javadoc comments in Java code.

The downside is that it's based on Javadoc rather than Java annotations, and does not appear to be well-documented or very widely used.

1
  • Agreed. I tried to get into this stuff and abandon it in the end. Jun 16, 2009 at 10:00
0

There are a couple of free Java to AS3 converters out there of varying quality:

I cannot vouch for their quality but they claim to do what you are looking for.

Personally I take the overhead of maintaining the two code bases manually because once the objects settle there is not much to do and it means I don't have complex rules around the rest of the code which is in the objects.

Plus my Java objects all have getters and setters whereas the AS3 equivalents do not, which means the public/private accessors are different in any case.

HTH

1
  • The download link on the j2as3 site appears to be broken.
    – eli
    Oct 21, 2008 at 21:36
0

If you're going to be doing a Flex RIA app of any degree of sophistication, then you'll probably be implementing the MVC pattern - ala Cairngorm, Mate, or PureMVC.

Take a look at this Flex code generator as it anticipates your use of MVC in the Flex client and generates code suitably to deliver an even higher degree of leverage:

FCG : a Flex Code Generator

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.