Questions tagged [strategy-pattern]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
32 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: ...
1
vote
2answers
81 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
2answers
50 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
1answer
91 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
1answer
89 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
1answer
45 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
3answers
1k 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. ...