Quantcast
Channel: on using the strategy pattern to switch between database layers - Code Review Stack Exchange
Browsing latest articles
Browse All 3 View Live

Answer by Mostafa Kashwaa for on using the strategy pattern to switch between...

The short answer is: You don't need the strategy pattern here. just do as nullTermiator said in his answer.To understand why strategy does not fit here, first we need to understand the problem strategy...

View Article



Answer by nullTerminator for on using the strategy pattern to switch between...

Typically you'd have two classes that implement the four methods create, read, update and delete, one for Mongo and one for PostGres. Create a factory method that determines what kind of DB you are...

View Article

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 to...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images