Given: A LegacyControllerClass, which expands MonsterFrameworkClass(part of a very vibrant structure with which people simply live for years). The Framework class has a lot of magic: from tons of logic in the default constructor to static blocks that reflectively load classes.
Many life cycle techniques LegacyControllerClassthat mutate global states. The method execute()is a thousand liners that have all the evil you can think of.
public class LegacyControllerClass extends MonsterFrameworkClass {
public void validate(){...}
public void preExecute() {...}
public void execute() {
}
}
, execute(). Test-Driven-Development , , "". "" responseProperties, view (jsp) . :
if (error) {
Build the error message
Add the error message into the responseProperties
}
, , execute().
: ?
, , :
rubbish1() rubbish2()- (, - )
rubbish1() rubbish2()
, MonsterFrameworkClass : , , ResourceBundle ..
?
Teeny-tiny . " " gulp , SO, , .