C
C#4w ago
Dalia

strategy design pattern on discount

I need to use strategy design patter and thee only thing i could think of is for the discounts, but im not sure how it should be implemented.
6 Replies
jiniux
jiniux4w ago
context?
Sossenbinder
Sossenbinder4w ago
I agree, more context would be great. But I imagine this is some kind of uni / school task which just wants to see any usage of the pattern? What I could think of would be having a sales component in your system which should dynamically react on specific pricing policies. That could be discounts, it could however also be different sales logic for different consumer markets, which might be extended without you wanting to touch the initial component tapping into these strategies
Mayor McCheese
A frequent example is travel to a place, for example, you're traveling to work, but you have different strategies to get there. Walking, a bike, a bus, and a car. The strategy is the mode of transportation.
Mayor McCheese
Each mode of transportation is its own algorithm that can be used interchangeably
Want results from more Discord servers?
Add your server
More Posts