java-design-patterns icon indicating copy to clipboard operation
java-design-patterns copied to clipboard

Money pattern

Open iluwatar opened this issue 5 years ago • 10 comments

Description

The Money design pattern, as described by Martin Fowler, provides a way to encapsulate monetary values and their associated currencies. This pattern helps in handling calculations and operations involving money in a clear and reliable manner, avoiding common issues like rounding errors and ensuring currency consistency.

Key Elements of the Money Pattern:

  • Encapsulation of a monetary value along with its currency.
  • Operations involving monetary values, such as addition, subtraction, and multiplication, which consider the currency.
  • Proper handling of rounding issues.
  • Conversion between different currencies using an exchange rate.

References

Acceptance Criteria

  1. Create a Money class that encapsulates a monetary value and its associated currency.
  2. Implement operations (addition, subtraction, multiplication) on the Money class that handle currency consistency and rounding issues.
  3. Add functionality for currency conversion with appropriate handling of exchange rates.

iluwatar avatar Jul 07 '20 17:07 iluwatar

Hi, I am very enthusiasm to lean on that issue. I read the topic of this pattern but what is the purpose of this issue. Would I have to code this pattern in Java ? I don't see your request. Please I would like to have more informations about your aim.

Best regards. Sophonie.

sophonie avatar Oct 29 '20 22:10 sophonie

Yes @sophonie, I'm sorry for the poor description in this issue. The aim is to create an example implementation of Money pattern in this repository. You can check how the other patterns have been implemented and follow the same style. There are also brief contribution instruction at https://github.com/iluwatar/java-design-patterns/wiki/01.-How-to-contribute

Please let me know if you want to try implementing this pattern.

iluwatar avatar Dec 07 '20 18:12 iluwatar

I've submitted a PR for this issue. See -> #1673 Sorry if I didn't let you know before actually working on the pattern. @iluwatar

ImLynxie avatar Mar 11 '21 20:03 ImLynxie

This issue is free for taking again.

iluwatar avatar Jan 06 '22 17:01 iluwatar

Hi, I'd like to work on this issue. Could it be assigned to me if still available?

Liu-rj avatar Mar 18 '22 09:03 Liu-rj

Yes @Liu-rj, please go ahead

iluwatar avatar Jul 01 '22 15:07 iluwatar

@Liu-rj are you working on this?

iluwatar avatar Sep 21 '22 17:09 iluwatar

@iluwatar yeah, I will fix that pr #1984 these days once I have time.

Liu-rj avatar Sep 22 '22 03:09 Liu-rj

Hi, I would like to take on this issue!

hheanly123 avatar Oct 06 '23 01:10 hheanly123

This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 07 '23 08:12 stale[bot]