Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [strategy]

A strategy is a general approach used to achieve goals, to address similar needs, or to solve a family of issues.

Filter by
Sorted by
Tagged with
2 votes
2 answers
164 views

Proving two XML schema's are functionally equivalent

I work for a standards organization that publishes an exchange standard using XSD files. These XSD files are being generated from a model with a tool, and now we want to change to a new tool. Because ...
Geert Bellekens's user avatar
1 vote
3 answers
396 views

Is my git branch strategy best practice?

We are a small software team with 6 members. We are working on different software projects in our company. Before I joined the team no version control system was used. It was/is my task to reorganize ...
Jakob's user avatar
  • 31
1 vote
1 answer
2k views

Branching strategy for developing multiple features at the same time

We are doing a mobile app development and currently, we have Dev - UAT - Staging - Main branches. We branch from the Main branch as feature/fA for feature development. We do our development in that ...
Kdaydin's user avatar
  • 135
1 vote
2 answers
152 views

How can I enable user data sovereignty in a B2B SaaS application?

We develop a SaaS solution that processes customer ERP data and provides analyses from it in a front-end. The software is a standard solution and should require as little customization as possible for ...
Dennis's user avatar
  • 13
0 votes
2 answers
294 views

Coffee machine strategy pattern implementation

I came across an article about LSP https://stackify.com/solid-design-liskov-substitution-principle/ . It seems that a strategy pattern could be implemented here but I cannot see how to implement it. ...
Gullit's user avatar
  • 13
-3 votes
1 answer
226 views

Combining Strategies (Design Patterns) [closed]

If I have two boolean variables B1 and B2 whose value combinations cover four independent behavior functions (MFF, MFT, MTF, MTT), then how many concrete strategy (design pattern) classes should I ...
Jim Girard's user avatar
2 votes
1 answer
209 views

How to implement Gang of Four's Lexi's Compositor-Composition?

I'm studying Design Patterns book and I was trying to understand the Composition principle in Lexi's Compositor-Composition as explained in figure 2.5, as well as how to implement it. Where the ...
Christian H's user avatar
0 votes
3 answers
117 views

Strategy & Architectural Decision: Customer data migration between two companies

Asked this originally here, and didn't receive any answer so far, hence posting here too. Let's say company A acquired company B in a certain region. This means, A and B were competitors in that ...
Munim's user avatar
  • 119
-4 votes
5 answers
3k views

Disadvantage of the strategy pattern and how to overcome it

An often quoted disadvantage of the strategy pattern is: The application must be aware of all the strategies to select the right one for the right situation Why is this a disadvantage and what can ...
David's user avatar
  • 155
7 votes
2 answers
443 views

The "real and effective" GIT CI/CD strategy

I've started in this new company a few weeks ago, this is the CTO CI strategy: Current: Developer team has the repo prod/master and they merge everything into master (no branching strategy). Once the ...
Miguel Ortiz's user avatar
0 votes
1 answer
1k views

Discount calculation pattern

I am implementing a discount calculation model. One item PER order. I do have a Product class: public class Product { public string Name { get; set; } public Size Size { get; set; } public ...
Marius's user avatar
  • 117
2 votes
3 answers
1k views

Reconciling MVC with a strategy pattern

I am working on a Rails application which employs a classic MVC as its fundamental structure. In that structure the controller is supposed to be responsible for "which view to render when". Now after ...
ivanibash's user avatar
  • 143
17 votes
5 answers
2k views

How to comprehend abstraction in code?

When looking at a new codebase I like to start from a bottom-up approach. Where I comprehend one file and then move up to the next abstraction. But often times I find myself forgetting what the ...
John DeBord's user avatar
1 vote
1 answer
144 views

(Fuzzy) Data duplication detection - scoring systems strategy

Many systems that store data in a structured manner (although this is marked language agnostic, the origin of this question is an MS SQL database) struggle with duplicates. Taking a physical person/...
ExternalUse's user avatar
0 votes
2 answers
152 views

Strategy to review all occurrences of specific field in large project

The project I am working on has a status field which currently only allows YES or NO, and I am about to refactor it to allow the value MAYBE. Unfortunately, it is used over 1,000 times in 200+ files. ...
Wrokar's user avatar
  • 109
12 votes
4 answers
4k views

Rich domain model vs strategy pattern in DDD

I've recently watched a few Pluralshigh courses on DDD by Vladimir Khorikov. He was encouraging to create a rich instead of anemic domain models. It all looked very nice in a small test-project, ...
Andrzej Gis's user avatar
  • 1,003
2 votes
2 answers
1k views

Algorithm for splitting players into unique group every round

For a match I have certain number of players, certain number of groups (players and groups are aliquot) and certain number of rounds to be played (players are reshuffled every round). Ideally, I'd ...
David162795's user avatar
4 votes
2 answers
2k views

Internal REST API versioning strategy

We are developing internal api's for integrating the server side logic (backend) with frontend (web, mobile etc). We have a java stack in our backend and front end is coded in react and react native. ...
Andy Dufresne's user avatar
1 vote
1 answer
174 views

Objective-C: Strategy Pattern, is mainly by selector?

To use Strategy Pattern in Objective-C, I think it is mainly by selector. To omit if...else, use Objective-C runtime, convert string matching to choose selector (Strategy). Am my understanding ...
dengApro's user avatar
  • 117
2 votes
1 answer
150 views

Looking for a strategy to ensure name of child node stays unique in collection

Even though I'm programming in PHP, I'm open to reviewing language-agnostic suggestions, as they might point me to valuable directions. To remove any possible confusion I feel some comments appear to ...
Decent Dabbler's user avatar
1 vote
1 answer
150 views

Inheritance or strategy in my circular buffer

I've looked at some other threads but they don't quite answer my question, I think... I have a CircularBuffer object which I have separated from a ThreadSafeCircularBuffer object so that the CB logic ...
Jimbo's user avatar
  • 217
-2 votes
1 answer
58 views

What method/ approach is used to query a user's page on a website using backslash + username? [closed]

I am working on a Servlet/JSP project, the website have users and I need to display a user's profile using the notation myDomain.com/Joe instead of myDomain.com/users.jsp?user=Joe. An instance of my ...
aero's user avatar
  • 107
0 votes
1 answer
322 views

How To: .Net periodic task to validate entries in tables

I am looking for a solution following best practices to simply periodically validate database entries against some business logic. For instance, I have the database with employees, and another table ...
Alex's user avatar
  • 127
16 votes
2 answers
13k views

What do I use as an alternative to Domain-Driven Design, if I cannot define a Competitive-Advantage area of my system to apply it?

From all I read and watch, Domain-Driven Design (DDD), is a costly and time-consuming endeavor. In fact, everyone I have seen, including Eric Evans and Greg Young, say, don't use DDD except where you ...
johnny's user avatar
  • 3,679
5 votes
1 answer
429 views

When can client code know about strategy pattern implementations?

I am considering using a strategy pattern for configuration file management, that way I can support some legacy configs. I feel pretty solid on the overall design (as its pretty standard strategy ...
ÁEDÁN's user avatar
  • 143
0 votes
1 answer
524 views

For learning purposes, how should I set about implementing an arbitrary precision library in C or C++?

I know I am reinventing the wheel. But I'm really interested in implementing arbitrary precision numbers (integers, rationals, complex, etc) in C or C++ and their algorithms. Please be patient. My ...
Hungry Blue Dev's user avatar
0 votes
1 answer
2k views

How to design a Rule Engine Validation System to be asynchronous and highly performant!

I am implementing a validation system which has some constraints, there are category of users let's say 30 and for each category there are number of rules. Actually there are 100 different rules. I ...
John Doe's user avatar
  • 111
0 votes
3 answers
8k views

Strategy Pattern with abstract class instead of interface?

Is the strategy in the strategy pattern always an interface? What pattern would it be when the strategy is abstract?
robtothein's user avatar
2 votes
2 answers
978 views

Best approach parsing input in multiple scenarios

I am developing an API that has one call that accepts a big JSON object. Based on this object, there are 10 possible parsing scenarios, i.e. if field xxxx.xxx is present, go with scenario 5. We ...
Mazzy's user avatar
  • 171
1 vote
1 answer
100 views

How to build visibility into a background worker service?

I have been working on a cloud-based background worker service, and regrettably it is almost "blind". What I mean by this is it is incredibly difficult to get any insight into what is going on, aside ...
Ben Harrison's user avatar
  • 1,233
3 votes
3 answers
769 views

Should you refactor all helper classes into small obects with state?

Imagine you want to have a room painted. You are the owner of this room and a Painter is capable of painting the room. There are different types of Painters: a BluePainter, a RedPainter etc. For every ...
user2180613's user avatar
  • 1,782
3 votes
2 answers
5k views

Implementing strategy pattern multiple variables?

I am trying to implement Strategy Pattern for handling my content serialization and deserialization. So I have four kind of requests namely CREATE, RETRIEVE, UPDATE, DELETE and for each request I want ...
Siddharth Trikha's user avatar
3 votes
1 answer
152 views

What is the best serial port connection strategy

I am developing a program that polls a device for actvity. In the past I have always used a USB device with a pure USB device driver. The upside of this was that that device was blazingly fast. The ...
StanB123's user avatar
  • 131
5 votes
2 answers
690 views

Does such a design pattern exist? (Multi-Strategy/Multi-Traits)

Is there a design pattern that would allow a class from a hierarchy to 'subscribe to' concrete methods? For example, say you have an abstract base class that requires the implementation of a method. ...
Igneous01's user avatar
  • 2,333
15 votes
2 answers
3k views

Zero Downtime Deployment - Transitional Db Schema

Achieving Zero Downtime Deployment touched on the same issue but I need some advice on a strategy that I am considering. Context A web-based application with Apache/PHP for server-side processing and ...
user avatar
3 votes
1 answer
827 views

Persistence Strategies - Filling a cache strategy

Let's say I have an interface IDataAccessObject<TSource> with CRUD methods to access a data source. I have an implementation StrategyDataAccessObject<TSource>, which uses an strategy ...
Matias Cicero's user avatar
2 votes
1 answer
881 views

Best Possible Way To Write Unit Tests For HTTP Middleware

I am using this go library(https://github.com/abourget/goproxy) to create a custom proxy server app. The app is utilizing several middleware of the following form: MyMiddlewarFunc(ctx *goproxy....
Rana's user avatar
  • 141
1 vote
0 answers
61 views

Strategies for creating a mobile site? [closed]

I'm looking for 2nd & 3rd opinions on a general mobile strategy for a website I work with. We have decided that tablets generally have an acceptable experience with our site (especially in ...
Jeff's user avatar
  • 131
3 votes
3 answers
2k views

Why do we need a context class in strategy pattern?

For the strategy pattern, why do we need a context class to call the appropriate algorithm? Why can't we just do Strategy s = new OperationAdd()? This way, we still use polymorphism.
Armon Safai's user avatar
18 votes
6 answers
11k views

Advantages of Strategy Pattern

Why is it beneficial to use the strategy pattern if you can just write your code in if/then cases? For example: I have a TaxPayer class, and one of its methods calculates the taxes using different ...
Armon Safai's user avatar
2 votes
4 answers
472 views

Strategy pattern and "Is a" relationship

Imagine, I have class IAlgo which is an interface. I have derived from him and implemented his single method called matchCount in different implementations - AlgoA1, AlgoA2, AlgoA3, AlgoB1, AlgoB2. ...
Narek's user avatar
  • 1,143
2 votes
1 answer
240 views

Injection, strategies and OO

I'm working on refactoring a project. The business logic looks very much like using the Strategy pattern would be very beneficial, because depending on the values of three properties (let's say age, ...
user3748908's user avatar
  • 1,647
2 votes
1 answer
921 views

Decorater pattern or strategy pattern

I'm constructing a c# serverside application and I'm trying to do this in a way it can easily be maintained aswell as extended if needed. So what we have is 4 different requests that need to be done (...
8bitcat's user avatar
  • 131
1 vote
1 answer
771 views

Should factory make context or concrete strategies objects in strategy-factory pattern?

In a typical strategy pattern class Strategy { public: virtual int execute() const = 0; } class StrategyA : public Strategy { public: int execute() const override; } class StrategyB : ...
Daniel's user avatar
  • 239
4 votes
2 answers
4k views

Pattern for caching DAOs: strategy or decorator?

I'm building a php system with the Services/DAOs/Domain Models pattern, and now is the time to implement a caching system for the DAOs. Would you use a decorator pattern, or maybe the strategy ...
AntonioHS's user avatar
  • 187
4 votes
1 answer
1k views

Creating/updating entity save strategy

Please note: although I'm talking about Java in this question, what I'm asking about here should really be language-agnostic. I am dabbling in OR/M for the first time, and have cooked up the ...
smeeb's user avatar
  • 4,880
0 votes
1 answer
436 views

How to organize conversion logic for strategy pattern?

I have a Color class. It has a property model which is a class that implements ColorModel interface, this property could be a RGB, Hex or HSL classes which implementing ColorModel interface. // ...
volter9's user avatar
  • 156
0 votes
1 answer
135 views

How to compute data for charting?

I'm building a charting component that displays data directly from the raw data records. It should be able to filter data (subset) and then perform some rudimentry maths on the data (sum, avg, etc). ...
Robin Rodricks's user avatar
1 vote
1 answer
453 views

Strategy vs Publiser-subscriber pattern

Let's say I have a channel endpoint where I receive messages. Because I want to process messages in a different way depending on its Header property, rather than create a massive switch I create ...
NullOrEmpty's user avatar
4 votes
2 answers
433 views

Strategy game, how do I calculate the parallel actions?

I am building a strategy game where multiple units(5 - 20) fighting each other. I have a game logic that calculate all the actions that been done on each turn, and send it to the game engine to ...
Ilya Gazman's user avatar