If Spring creates a DAG of beans it got to create. What is the additional benfit of using @DependOn?

237 views Asked by At

Here, is a detailed post on how spring dependencies on one another can be resolved using @DependsOn --> Controlling Bean Creation Order with @DependsOn Annotation

But some time in the past I have read that spring container creates a DAG of all the beans before it starts initiating or creating the beans. If this is the case, dependencies are automatically addressed using DAG mechanism. So is not @DependsOn redundant.

But if Spring framework is providing one such annotation explicitly, I assume it must carry some real importance. Could someone clarify if there's something I am missing?

0

There are 0 answers