Y
Hacker News
new
|
ask
|
show
|
jobs
by
gboyer
5149 days ago
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.
1 comments
colomon
5149 days ago
That works great if you're only using one interface in your class. What if you need to include two?
link
gboyer
5149 days ago
Then you use a different reuse strategy, like composition. The language is not ideal in this regard, certainly.
link