Skip to main content

[JSR-354] Mathematical Operations on MonetaryAmount

  • From: Chris Pheby <chris@...>
  • To: "jcurrency_mail@..." <jcurrency_mail@...>
  • Subject: [JSR-354] Mathematical Operations on MonetaryAmount
  • Date: Sat, 13 Jul 2013 14:15:02 +0000
  • Accept-language: en-GB, en-US

On MonetaryAmount, most of the mathematical operations are overloaded for 
both MonetaryAmount and Number as parameters. I am not sure this should be 
the case.

For example, add and subtract:

    public Money add(MonetaryAmount amount);
    public Money add(Number amount);

Adding two MonetaryAccounts makes perfect sense, but adding a number to a 
monetary amt - less clear. Why not just convert the number to a 
MonetaryAmount explicitly.

For the multiply, divide... and remainder methods, the opposite may be true. 
In this case, it is unclear what the meaning of using a MonetaryAmount as an 
operand is.

Regards Chris





[JSR-354] Mathematical Operations on MonetaryAmount

Chris Pheby 07/13/2013

[JSR-354] Re: Mathematical Operations on MonetaryAmount

Werner Keil 07/13/2013

[JSR-354] Re: Mathematical Operations on MonetaryAmount

Chris Pheby 07/13/2013

[JSR-354] Re: Mathematical Operations on MonetaryAmount

Werner Keil 07/13/2013

[JSR-354] Re: Mathematical Operations on MonetaryAmount

tom.huesler@... 07/13/2013

[JSR-354] Re: Mathematical Operations on MonetaryAmount

Werner Keil 07/14/2013

[JSR-354] Re: Mathematical Operations on MonetaryAmount

Chris Pheby 07/14/2013

[JSR-354] Re: Mathematical Operations on MonetaryAmount

Stephen Colebourne 07/14/2013

[JSR-354] Re: Mathematical Operations on MonetaryAmount

Werner Keil 07/14/2013

[JSR-354] Re: Mathematical Operations on MonetaryAmount

Werner Keil 07/14/2013

[JSR-354] Re: Mathematical Operations on MonetaryAmount

Werner Keil 07/16/2013
 
 
Close
loading
Please Confirm
Close