Questions tagged [strategy-pattern]
The strategy-pattern tag has no usage guidance.
12
questions
0
votes
1
answer
80
views
Strategy Pattern Inside State Pattern
I'm making a fps game where I created a hierarchical state machine; the problem is the two types of movement (standing movement and crouching movement). They are very similar; the only difference is ...
3
votes
0
answers
62
views
Entities with varied Movement polymorphic implementations in Julia
I have very basic principle. I have multiple types of entities with some shared functionality. Some of this functionality is highly customizable and you want to be able to swap it out even for a ...
1
vote
0
answers
144
views
Applying the Strategy pattern for payment methods
The strategy pattern is applied in the code below in the payment separation solution. Please evaluate if it is well done according to standards. I would be very grateful for suggestions.
...
2
votes
2
answers
70
views
Virtual method with variations for different types
Each animal type will call reactToOwner() and exhibit its own behaviour. So simply define a reactToOwner() override for each
...
0
votes
0
answers
177
views
Implementation of Strategy Pattern for Task Scheduler
I need to implement a feature that schedules notifications to a user to which a Task has been assigned. The schedule could be one-time or on a ...
0
votes
1
answer
126
views
Refactor typescript long switch case that run different code in according to property value
I have a typescript function that executes an array of actions on a given string value. This is the code:
...
0
votes
2
answers
345
views
Strategy Design Pattern in ASP.Net Core MVC Project
I tried to make a calculator using the Strategy pattern in ASP.Net Core MVC (following an example from the Internet)
Please review my code and tell me what could be wrong and how to make it better?
My ...
0
votes
2
answers
219
views
on using the strategy pattern to switch between database layers
I'd like to build an app in Flask that can switch between talking to a PostGresql and a Mongo DB. As I understand it, the Strategy Pattern is about being able to switch algorithms that are referred ...
3
votes
1
answer
163
views
refactor python strategy pattern to use abstract base class
I came across this strategy pattern implementation
https://github.com/jtortorelli/head-first-design-patterns-python/blob/master/src/python/chapter_1/adventure_game.py
...
2
votes
1
answer
124
views
Implement Strategy pattern for 1. Print Report. 2. Movie type [closed]
I need to know whether I have implemented Strategy pattern correctly for below 3 classes provided to me for 2 tasks.1) Report Generation 2) Movie Type.
Below 3 classes were provided to me
Rental.java
...
1
vote
1
answer
47
views
Generating packing slips depending on product type
My abstract class. Product will have multiple child classes those will be different types of Product
...
3
votes
3
answers
3k
views
Calculator Object Oriented Design
I am aiming to implement a calculator in an object-oriented way.
Here is the solution by using the strategy pattern.
Looking forward to some valuable comments.
...