3 ms·
Can you provide some concrete examples? I.e. pattern X was recommended for a scenario Y, but ended up in over-engineering hell for Z.
by nivertech 6y ago
Can you provide some concrete examples?
I.e. pattern X was recommended for a scenario Y, but ended up in over-engineering hell for Z.
- withinboredom 6y agoIoC is one that comes to mind. It greatly simplifies testing, but the engineering (before we had libraries for it) was ridiculous to implement.
- mmcdermott 6y agoI think this is a good one. Most recent Java/C# systems would have a full IoC container, but have no dynamically selected components (which is how frameworks like Dagger -https://dagger.dev/ https://dagger.dev/ - can exist). A lot of runtime reflection/calculation gets done for something that can be known at compile time.
- ivanche 6y agoUsable IoC actually can be implemented in just 4-5 classes. Yes, it won't be as powerful as Guice but for some (or a lot?) of applications it's probably enough. [0] http://misko.hevery.com/2010/05/26/do-it-yourself-dependency-injection/ http://misko.hevery.com/2010/05/26/do-it-yourself-dependency... [1] http://blacksheep.parry.org/wp-content/uploads/2010/03/DIY-DI.pdf http://blacksheep.parry.org/wp-content/uploads/2010/03/DIY-D...
- withinboredom 6y agoCompared to just creating your own dependencies inside a class and not writing interfaces, IOC adds a great deal of complexity.
- ivanche 6y agoYou don't have to write interfaces to have dependency injection. You can and should declare all your dependencies as constructor parameters. If you create them inside a class you'll permanently lock the two together, thus making it a testability nightmare.