So the group I'm working with has reduced the amount of code we need to enter for certain things. In this case, the Spring webpage that displays the list using DisplayTag libraries. The way this is done is a class using generics extending the object Controller, and then subclassing this for each page it should work on.
This controller displays SystemErrorReportand determines the type SystemErrorReportCommand.
public class SystemErrorReportController extends
GenericSearchAndSelectController<SystemErrorReportCommand> {
The problem is that SystemErrorReportCommandbeing passed as a type needs to be manually declared in its constructor, for example:
public SystemErrorReportCommand()
{
super(SystemErrorReport.class);
}
Then the command object is passed to what its explicit type must know. Without manually specifying it somewhere, it returns as GenericCommand, another class of ours, because the bit SystemErrorReportCommandis lost after compilation.
I am not happy with this because it seems that we can automate more to reduce the developer error. Is there a more elegant way to do this, or am I sticking to this because of erasing styles?
source
share