I like this idea a lot, effectively, you're registering, iterating and picking with a lot less overhead / boilerplate. You can call it a lot of things - it is a form of dependency injection, though not the one I'm used to - but it's definitely a way to clean up what would otherwise be a tangled knot of logic. I approve!
Yeah, I’ve always thought of this pattern as a kind of factory in that it provides a specific implementation based on a parameter, but it does lack the characteristic of instantiating the classes which is the basis for a factory, so I guess we’ll have to come up with a better name!
Thanks a lot for your support!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I like this idea a lot, effectively, you're registering, iterating and picking with a lot less overhead / boilerplate. You can call it a lot of things - it is a form of dependency injection, though not the one I'm used to - but it's definitely a way to clean up what would otherwise be a tangled knot of logic. I approve!
Hi Eric, I’m really glad you liked it!
Yeah, I’ve always thought of this pattern as a kind of factory in that it provides a specific implementation based on a parameter, but it does lack the characteristic of instantiating the classes which is the basis for a factory, so I guess we’ll have to come up with a better name!
Thanks a lot for your support!