Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Money pattern #1305

Closed
iluwatar opened this issue Jul 7, 2020 · 11 comments · Fixed by #3109
Closed

Money pattern #1305

iluwatar opened this issue Jul 7, 2020 · 11 comments · Fixed by #3109

Comments

@iluwatar
Copy link
Owner

iluwatar commented Jul 7, 2020

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.
@sophonie
Copy link

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.

@iluwatar
Copy link
Owner Author

iluwatar commented Dec 7, 2020

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.

@ImLynxie
Copy link
Contributor

ImLynxie commented Mar 11, 2021

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

@iluwatar
Copy link
Owner Author

iluwatar commented Jan 6, 2022

This issue is free for taking again.

@Liu-rj
Copy link
Contributor

Liu-rj commented Mar 18, 2022

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

@iluwatar
Copy link
Owner Author

iluwatar commented Jul 1, 2022

Yes @Liu-rj, please go ahead

@iluwatar
Copy link
Owner Author

@Liu-rj are you working on this?

@Liu-rj
Copy link
Contributor

Liu-rj commented Sep 22, 2022

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

hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 15, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 15, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 15, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 15, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 15, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 15, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 15, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 15, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 15, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 17, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 17, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 27, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 27, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 27, 2023
hheanly123 added a commit to hheanly123/java-design-patterns that referenced this issue Oct 27, 2023
Copy link

stale bot commented Dec 7, 2023

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 stale bot added the status: stale issues and pull requests that have not had recent interaction label Dec 7, 2023
@stale stale bot removed the status: stale issues and pull requests that have not had recent interaction label Mar 17, 2024
@iluwatar iluwatar added info: help wanted status: stale issues and pull requests that have not had recent interaction labels Mar 17, 2024
@iluwatar iluwatar moved this from In Progress to Todo in Java Design Patterns project Mar 17, 2024
@stale stale bot removed the status: stale issues and pull requests that have not had recent interaction label Mar 17, 2024
@Ahmed-Taha-981
Copy link
Contributor

Hi, this issue seems interesting, I'll start on my implementation, could you please assign it to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants