4 ms·
Can you expand on this? I'm interested to see how this works in a real code base. I'm thinking something like an initial (maybe massive) if block in the setup
by backslash_16 10y ago
Can you expand on this? I'm interested to see how this works in a real code base.
I'm thinking something like an initial (maybe massive) if block in the setup of the application that sets all of the behavior/features by declaring which implementations get set to which interfaces? After this if block, all of the DI stuff is set?
This of course means you need to use a DI framework of some sort.
Using feature flags is something I'm investigating because our current model is a git branch for every feature, and I wonder/fear it only works because we're a small team that has worked together for a while and in the future when we grow this will break down.
- adamconroy 10y agoI was about to say the same thing as your parent. I recently had a nice feature toggle experience using a strategy pattern with DI. Basically there was one 'if' statement in the DI container configuration code that looked up a config. Basically if (newPricingStrategy) bind IPricingStrategy to NewPricingStrategyImplementation else bind IPricingStrategy to OldPricingStrategyImplementation