-
-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Closed
Description
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
- Martin Fowler's Money Pattern
- Patterns of Enterprise Application Architecture by Martin Fowler (Page 303)
Acceptance Criteria
- Create a
Moneyclass that encapsulates a monetary value and its associated currency. - Implement operations (addition, subtraction, multiplication) on the
Moneyclass that handle currency consistency and rounding issues. - Add functionality for currency conversion with appropriate handling of exchange rates.
Metadata
Metadata
Assignees
Projects
Status
Done