C
C#2y 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
Pobiega2y 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
moshimoshiOP2y ago
I am planning to override some accessor methods perhaps can use interface yea? That would make more sense..!
Pobiega
Pobiega2y ago
That could certainly work
moshimoshi
moshimoshiOP2y ago
Thank you for the clarifications!
Accord
Accord2y 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.
Want results from more Discord servers?
Add your server