Replace getter setter with reflection in spring.xml

43 views Asked by At

I have a populator without any business logic.

public void populate(final PaymentModeModel source, final PaymentModeData target)
    {
        target.setCode(source.getCode());
        target.setName(source.getName());
        target.setDescription(source.getDescription());
    }

I have seen code in the past where simply entering the attribute names in the spring.xml file will do the trick and I can get rid of the entire populator class. It involves reflection.

1

There are 1 answers

0
mkysoft On

New hybris versions has orika mapper and it is used for occ. Maybe you saw this. You can also use it but performance won't same as manual coding.