jochen777 / jWebForm

Java WebForm Library: HTML Form generation and validation
MIT License
17 stars 2 forks source link

Reconsider using the term "view" in the APIs #2

Open odrotbohm opened 6 years ago

odrotbohm commented 6 years ago
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.

jochen777 commented 6 years ago

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

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

odrotbohm commented 6 years ago

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.

jochen777 commented 5 years ago

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);