title: Custom Marshalling from Java to Flex via BlazeDS
body: <p>My team are putting together a proof-of-concept Flex application sitting on top of a Spring-based server using BlazeDS.</p>
  
  <p>We do quite a lot of date calculations, so we use Joda Time extensively throughout the code and in our domain model.</p>
  
  <p>We're now trying to figure out how we can continue to use Joda Time in our DTOs that are sent back-and-forth with the Flex frontend via BlazeDS.</p>
  
  <p>Our goal is to use the Actionscript 3 data type <code>Date</code> on the Flex side and have that map to our use of Joda time's <code>DateTime</code>, <code>LocalDate</code> and <code>LocalTime</code> types on the Java side.</p>
  
  <p>We can solve the problem of converting Actionscript 3's <code>Date</code> type when calling Java with a custom type marshaller plugged into BlazeDS, but this appears to only be invoked for the Flex->Java/BlazeDS direction and not for the Java/BlazeDS->Flex direction.</p>
  
  <p>I'm now looking at custom <code>PropertyProxy</code> implementations for BlazeDS, but this doesn't look like the right thing either.</p>
  
  <p>The other idea was to implement <code>Externalizable</code> on our Java DTOs, but this seems like too much work, especially when I look at the BlazeDS rival GraniteDS and that shows plugging in Joda Time support in their documentation with a simple type converter!</p>
  
  <p>Any ideas appreciated.</p>