Hacker News new | past | comments | ask | show | jobs | submit login

Sorry. It's Java. The GunShotWound has to come from a GunShotWoundFactory.



Unfortunately, GunShotWoundFactory now needs to implement AbstractGunshotWoundFactory so that we can support multiple types of gunshot wounds.

Of course, we'll need an AbstractGunshotWound as well and a subclass for each type of gun used.

Needless abstractions make my head HURT!


DON'T WORRY GUYS! Dependency injection to the rescue!


The WoundFactoryFactory will take care of it.


Actually, I'll be honest: I quite like dependency injection. There are a lot of really good things that can be done with Guice. I've written one for C++ here: https://bitbucket.org/cheez/dicpp/wiki/Home


Or Python.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: