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

Um, aren't shared implementations exactly what you're not supposed to use inheritance for? According to the Liskov Substitution Principle (http://www.objectmentor.com/resources/articles/lsp.pdf), if it's not transparently substitutable, it shouldn't be a subclass.


Probably. But I don't care what the OO academics say: look how they designed JUnit.

I find class-based inheritance most useful for reusing base implementations, and interfaces (explicit or implicit) for conceptual encapsulation. I wish Liskov the best of luck in her software writing.




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

Search: