Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gboyer
on May 8, 2012
|
parent
|
context
|
favorite
| on:
The Brittleness Of Type Hierarchies
You can just do both, though. Use interfaces for polymorphism, to define the interactions between your objects -- and then, if you want, use inheritance as one possible strategy for code reuse.
colomon
on May 8, 2012
[–]
That works great if you're only using one interface in your class. What if you need to include two?
gboyer
on May 8, 2012
|
parent
[–]
Then you use a different reuse strategy, like composition. The language is not ideal in this regard, certainly.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: