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

Person has a GunShotWound, which is a subclass of Wound. (cf. AbrasionWound, LacerationWound, etc.) Also note the new properties such as bulletType, entryPoint, and fragmentationPattern.


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.




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

Search: