❔ Dependency injection & inheritance
There are 2 classes - tours and tour package. I'm planning to use dependency injection on an instance of tours into tour package. Does it mean that I'll be able to inherit its attributes too? Why/ whynot?
5 Replies
DI and inheritance dont have any special relationship.
In your example, would tour package inherit from tour?
(that makes no sense, imho)
remember, inheritance implies a "IS A" relationship
I am planning to override some accessor methods
perhaps can use interface yea? That would make more sense..!
That could certainly work
Thank you for the clarifications!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.