Questions tagged [strategy-pattern]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
35 views

How to remove duplicates of code and apply pattern? [closed]

I have the following class: ...
0
votes
2answers
40 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
68 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
63 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
44 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
380 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. ...