I have two objects:
Form. A form that I populate from a JSP page.Input. An input object for a web service call.
The input object is not suited to use to fill the form fields on my JSP page.
I need to populate the values in the Input object based on the values in the Form object. Is any of these options better?
Input object and call the Input setters from my controller.Form.loadTo(Input target). Implement a method in the Form class that takes an Input object as a parameter and call the Input setters in the loadTo method.Input.loadFrom(Form source). Implement a method in the Input class that takes a Form object as a parameter and load valus by calling getters from the Form.Translator.loadTo(Form source, Input target). Create a third class to encapsulate the translation logic. This is my preference because it controls the coupling of the the Form and Input classes, but it seems like overkill.
SRP.