vorto
vorto copied to clipboard
How to model Java "big" numbers
I am building a Vorto model based on some Java interfaces. One of the used data types is BigDecimal. I would like to ask you, what's the preferred mapping to the Vorto model? I can see two possibilities with their own advantages and disadvantages:
- BigDecimal to double - the main disadvantage here, lost precision
- BigDecimal to string - the main disadvantage here, lost numeric representation
What is you suggestion? Actually, it's the same question about BigInteger.
I would suggest to introduce new/updated basic types in the Vorto DSL (similar to the XSD basic types), which can be mapped in Java, as described here: https://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXBWorks4.html Does it make sense?
This issue requires some research, what the necessary basic types are - the types should still be platform-independent and follow standardized conventions.