1

I don't have any code with me to show you guys, but all I need to know that does Dependency Injection work in a scenario where a class implements multiple interfaces.

I do know about a single interface implemented by multiple classes using Dependency Injection.

3
  • What do you mean by work for classes with multiple interfaces? Do you merely want to register and retrieve instances of a class regardless of whether it implements two interfaces or not? Commented Apr 16, 2014 at 1:24
  • ya thats what I wanna do register and retrieve instances of class and get the concrete implementation of those interfaces which this class inherits. Commented Apr 16, 2014 at 2:33
  • Ok, then I agree with John's answer. Commented Apr 16, 2014 at 3:05

1 Answer 1

2

Yes.

Why wouldn't it? As long as the class implements the interface you need you shouldn't have to care what else the class happens to implement.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.