bring the implementation of additional code to support them
require the additional try{}catch{} blocks to handle the class behavior properly
The following methods should be removed or modified
release() - the sense of this method is to release the instance state, because of this, instance of class is not usable until user calls method 'init'.
If it is necessary to change the state of the class instance in one transaction, it is better to use
a) pattern state - implement the State class and use the method setState
b) replace the method release with reset one, where reset should have the list of the parameters to activate a new class state
This method MUST be replaced.
isInitialized - MUST be removed because the sense if this method, to be sure, that method init has been called after release
This method is the source of the following problems
a) isInitialized MUST be called in all methods of the class, besides, the exception MUST be thrown if isInitialized is false
b) all calls of then class methods MUST be inside of block try{}catch{}
c) because of 'a' and 'b', the source code grows and class is more complicated
Solution
Redesign the class to use the State pattern or method reset.
Description
There are some methods that:
The following methods should be removed or modified
release() - the sense of this method is to release the instance state, because of this, instance of class is not usable until user calls method 'init'. If it is necessary to change the state of the class instance in one transaction, it is better to use a) pattern state - implement the State class and use the method setState b) replace the method release with reset one, where reset should have the list of the parameters to activate a new class state This method MUST be replaced.
isInitialized - MUST be removed because the sense if this method, to be sure, that method init has been called after release This method is the source of the following problems a) isInitialized MUST be called in all methods of the class, besides, the exception MUST be thrown if isInitialized is false b) all calls of then class methods MUST be inside of block try{}catch{} c) because of 'a' and 'b', the source code grows and class is more complicated
Solution
Redesign the class to use the State pattern or method reset.