Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

IoC is one that comes to mind. It greatly simplifies testing, but the engineering (before we had libraries for it) was ridiculous to implement.


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

[1] http://blacksheep.parry.org/wp-content/uploads/2010/03/DIY-D...


Compared to just creating your own dependencies inside a class and not writing interfaces, IOC adds a great deal of complexity.


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


I 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/ - can exist). A lot of runtime reflection/calculation gets done for something that can be known at compile time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: