< bean id="exampleInitBean" class="examples.ExampleBean" init-method="init"/>... does not couple the code to Spring."
What this does is call init() when the class is created. Since this is in the Spring configuration, init() is only called when the class is created via the Spring framework. Hence the class is coupled to Spring and will not work without it.
The coupling may no be visible in the Java code, but it is still there. And moving things from Java to XML does the opposite of improving tings...
Keine Kommentare:
Kommentar veröffentlichen