jWebForm icon indicating copy to clipboard operation
jWebForm copied to clipboard

Reconsider using the term "view" in the APIs

Open odrotbohm opened this issue 6 years ago • 3 comments

model.addAttribute("form", formResult.getView());

To a Spring MVC developer this looks odd as the term view is already taken for the tempalte that get's rendered eventually. Also adding a view to a model doesn't sound right from a plain MVC point of view.

odrotbohm avatar Oct 29 '18 10:10 odrotbohm

Thank you for this hint and I get the point. Here are some suggestions:

  • FormModel
  • TemplateData
  • RenderData
  • FormRenderer
  • FormData
  • FormDefintion

What do you think? (My favorite is "FormModel")

jochen777 avatar Oct 29 '18 20:10 jochen777

FormModel sounds about right. I just wonder why one would've to lookup a dedicated object from the form in the first place and couldn't rather put that into the model and let the template integration to the lookup of that internal object.

odrotbohm avatar Oct 29 '18 22:10 odrotbohm

Ok, I refactored it to FormModel. The FormResult now must be passed directly to the template. Example: FormResult formResult = form.run(...); model.addAttribute("form", formResult);

jochen777 avatar Dec 02 '18 20:12 jochen777