C
C#15mo ago
moshimoshi

❔ 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
Pobiega
Pobiega15mo ago
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
moshimoshi
moshimoshi15mo ago
I am planning to override some accessor methods perhaps can use interface yea? That would make more sense..!
Pobiega
Pobiega15mo ago
That could certainly work
moshimoshi
moshimoshi15mo ago
Thank you for the clarifications!
Accord
Accord15mo ago
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.