Why do you need this?
The init method is called after all the bean properties have been set. This is usually necessary if the bean needs to do some initialization or property checking, which can only be done after all the properties have been set. (If you try to do this without calling the init callback, you will find that each property setter needs to check whether other setters have been called, etc. And even this strategy fails if initialization can only be completed after all properties in the beans loop.)
The destroy method is required if the bean contains resources that must be explicitly released; for example file descriptors, network sockets, database connections.
... how will a normal / good object oriented design dictate?
Any design methodology that dictates that the initialization and destruction of events / methods is โwrongโ or โforbiddenโ is unrealistic and should be ignored. In fact, object-oriented design methodologies usually do not dictate this. At best, they would say that this kind of thing is usually not needed.
In addition, DI actually changes the rules for the design methodology a bit ... at least in terms of initialization. In particular, by externalizing the "wiring" of instances, it pulls most of the logic out of the code in such a way that classical OO design methodologies do not expect. In any case, this suggests the need to revise the classical OO methodologies in the light of dependency injection.
source share