https://github.com/shaikrasheed99/strategy-pattern
Implementation of Strategy Pattern.
https://github.com/shaikrasheed99/strategy-pattern
design-patterns java strategy-pattern tdd tdd-java
Last synced: about 2 months ago
JSON representation
Implementation of Strategy Pattern.
- Host: GitHub
- URL: https://github.com/shaikrasheed99/strategy-pattern
- Owner: shaikrasheed99
- Created: 2022-04-11T10:16:40.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-15T15:43:05.000Z (about 3 years ago)
- Last Synced: 2025-01-13T19:39:00.111Z (4 months ago)
- Topics: design-patterns, java, strategy-pattern, tdd, tdd-java
- Language: Java
- Homepage:
- Size: 219 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Strategy pattern examples using Test Driven Development
## Example-1 (ShoppingMall):
* There is a shopping mall which will calculate the bill amount based on the discount coupon.
* Discount coupons will be used only on specific days, we will have percentages according to the days.
* Based on the week day, the shopping mall should give discounts at any point of time.
* Now strategy pattern is used, whenever a shopping mall needs a particular discount during run time.
### code: [shopping mall](https://github.com/shaikrasheed99/strategy-pattern/tree/master/src/main/java/com/tw)

## Example-2 (Student):
* There is a student who is studying a particular grade.
* If his grade is less than two, then he must write his homework with his slate pencil.
* If his grade is less than five and greater than two, then he must use a pencil for his homework.
* If his grade is greater than five, then he is allowed to use a pen for his writings
### code: [student](https://github.com/shaikrasheed99/strategy-pattern/tree/master/src/main/java/com/tw)
