https://github.com/plopezgit/sprint3_t2_patterns_part_2
Design pattern study
https://github.com/plopezgit/sprint3_t2_patterns_part_2
callback dependency-injection design-patterns observer-pattern
Last synced: 10 months ago
JSON representation
Design pattern study
- Host: GitHub
- URL: https://github.com/plopezgit/sprint3_t2_patterns_part_2
- Owner: plopezgit
- Created: 2023-11-09T09:37:19.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-24T10:21:40.000Z (over 2 years ago)
- Last Synced: 2025-03-21T14:23:59.061Z (about 1 year ago)
- Topics: callback, dependency-injection, design-patterns, observer-pattern
- Language: Java
- Homepage: https://refactoring.guru/design-patterns
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sprint3_T1_Patterns_Part_2
- Level 1
In all exercises, create a Gradle project with a Main class that demonstrates the use of the pattern (with any invocations that are needed).
**observe**
Design a system in which a Stock Exchange Agent (Observable) notifies several Stock Exchange agencies (Observers) of changes when the Stock Exchange goes up or down.
It is necessary for the Observable object to hold references to the Observers.
- Level 2
**Callback**
Simulates a payment gateway that receives an object encapsulating the payment method to be made: credit card, Paypal or bank account debt.
The gateway will invoke the payment without knowing the form and returning control to the parent class.
The class that invokes the payment gateway will be a shoe store.
- Level 3
**Dependency Injection**
Design a class that displays the price of various items on the screen. Since you will have to show them in several types of currency as well.
_Important_
Make sure to add as a Dependency Injection a CurrencyConverter class that performs the price correction based on the currency exchange.