java - Performance cost of refactoring similar methods into Strategy pattern? -
i find myself facing lot of similar methods repeating code in projects. general pattern seems (apologies vague code, licensing won't let me provide concrete example): public void modifytype1person() { map<string, ?> parameters = new hashmap<>(); parameters.put("type", "type1"); parameters.put("stringargument", "some name"); editpersonbasedontype(parameters); } public void modifytype2person() { map<string, ?> parameters = new hashmap<>(); parameters.put("type", "type2"); editpersonbasedontype(parameters); } public void modifydefaulttypeperson() { map<string, ?> parameters = new hashmap<>(); parameters.put("type", "othertype"); parameters.put("booleanargument", true); editpersonbasedontype(parameters); } public void editpersonbasedontype(ma