Hi Stackoverflow community,
I am working on some code where a list of optional criterias criterias is submitted to my dao. Method signature contains the list of +/- 10 parameters, which I really don't like and want to reformat. Plus I would like to avoid having to refactor all method signatures from different layers just because I add/remove a criteria
List searchParams(String name, Long countryCode, ...){
...
}
would become
List searchParams(HashMap<String,Object> map) {
BeanUtils.populate(this,map);
...
}
I am a bit worried that this happen to because kind of a bad practice, because I give up control of what is passed in the map to give me that flexibility ? So my question is if I am on the right path proceeding that way?