[Engine-devel] engine-core redundant instantiation of mappers
yzaslavs at redhat.com
Mon Jan 23 10:38:20 EST 2012
I am refactoring now DiskImageDAODbFacadeImpl.
As part of my work, I'm also defining there a Spring-JDBC mapper ,
similar to other ParameterizedRowMapper based mappers we have in code
(i.e DbUserDAODbFacadeImpl has one)
Looks like in our DAO getXXXX methods we instantiate these mapper
objects (each method creates a new mapper object).
Can anyone see a reason , in case a mapper object is stateless (and from
what I see, they are) - why not to have a single instantiation per
mapper type (i.e - Have a MapperUtils class, with static methods like
IMHO this can save us some unnecessary instanatiations and improve
More information about the Engine-devel