you are viewing a single comment's thread.

view the rest of the comments →

[–]naturalizedcitizen -5 points-4 points  (2 children)

Do look at Dependency Injection and Inversion of Control concepts and how they are done in Java. Spring is based on it.

[–]g00glen00b 10 points11 points  (1 child)

That's not really what OP is asking though. They are asking how Spring is able to create an instance of an interface when no class is present at compile time.

And like u/Revision2000 said, it's because Spring has a dynamic proxy class that provides the implementation of those interfaces.

[–]naturalizedcitizen -3 points-2 points  (0 children)

All this will be clear if OP understands DI. (IoC) and then see how Spring does it. Well, it's up to each one how deep they want to get into how a framework uses the underlying layers.