Announcement Announcement Module
No announcement yet.
How to use BigDecimal with Spring blazeds? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use BigDecimal with Spring blazeds?


    We need to do some simple financial calculation in our appilcation. However, the FLEX SDK do not provide BigDecimal class as JDK did.

    Now, I have found a 3rd party AS implementation of BigDecimal. However, I do not know how to integrate it with blazeDS(That means, if I pass a AS BigDecimal object parameter a server side object, the blazeDS know this object should be converted to a java BigDecimal object. When a java BigDecimal object is returned to FLEX application, it will be converted into a AS BigDecimal object). I found Spring blazeDS allow developer provide customize converter for data convertion but the info in the document is not detail enough and I am still not sure whether it can fuifill my requirement.

    Is there anybody can explain how to customize a data converter in Spring blazeDS( or provide me a link).
    I think BigDecimal is needed in a lot of financial application so that I guess the bigdecimal solution may have been discussed in this forum. If so, please give me the link.


  • #2
    As far as I know, BigDecimal / BigInteger and even reliable Java Long support for Flex is only implemented in GraniteDS, see documentation here. However, you will have to switch from Spring/BlazeDS to Spring/GraniteDS if you want to use this feature...


    • #3
      Yes, I am going to use the AS implementation from graniteDS. However, is there any approach to integrate graniteds bigdecimal with spring/blazeDS?


      • #4
        You can use the GraniteDS implementations of big numbers (AS3) in your Flex code, with or without BlazeDS (just compile your code against granite.swc library). The all problem is with serialization (Java <-> Flex) and I can't see any simple way to achieve it with BlazeDS. As I said before, you had better to switch to Spring/GraniteDS (though I understand that it can be difficult, time consuming or impossible, depending on the state of your current project).


        • #5
          I am not doing a real project. I just want to evaluate blazeDS, graniteds and SBI. It seems that blazeds is not so flexible in serialization customization.


          • #6
            I can't say much about BlazeDS... GraniteDS lets you customize the entire serialization process and has a quite unique feature with externalization and related code generation, see documentation here. Beside, it supports lazy-loading out-of-the-box (no need of an extension library such dphibernate for BlazeDS), scalable real-time messaging through asynchronous servlets, client-side entity management with the Tide framework, JSR-303 (aka bean validation) on the Flex-side, BigDecimal/BigInteger reliable serialization, etc.