java - Is it recommended to use the Spring's predefined InitializingBean and DisposableBean callbacks or not? -
is recommended use spring's predefined initializingbean
, disposablebean
callbacks or own init-method
, destroy-method
initialization
, cleanup
.
i started learning spring framework , confused follwing statements that,
it recommended do not use initializingbean or disposablebean callbacks, because xml configuration gives flexibility in terms of naming method. (from tutorial blog)
it recommended use spring's predefined initializingbean or disposablebean callbacks. (from tutor)
are both valid based on scenario?
the first 1 doesn't force class implement spring-proprietary interface, recommends using xml configure beans. xml is, quite frankly, awful, , spring has provided java configurations or simple annotations long time, allows removing need verbose, cumbersome, unsafe xml configuration.
i use standard postconstruct , predestroy annotations this.
Comments
Post a Comment