vorto icon indicating copy to clipboard operation
vorto copied to clipboard

How to model Java "big" numbers

Open e-grigorov opened this issue 6 years ago • 2 comments

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.

e-grigorov avatar Jun 28 '18 09:06 e-grigorov

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?

aedelmann avatar Oct 30 '18 03:10 aedelmann

This issue requires some research, what the necessary basic types are - the types should still be platform-independent and follow standardized conventions.

kolotu avatar Apr 14 '20 08:04 kolotu