Reputation: 1207
In all the examples I've reviewed of Grails command objects, the authors use new action names in their controllers (eg, "login", "register") rather than "create" or "save."
Does the use of command objects for processing form data preclude the use of "create" and "save" as function names in the controller? If yes, is it because these actions presume the use of domain objects rather than command objects?
(Context: trying to get a form to repopulate after a CO fails validation has been pure agony.)
Upvotes: 0
Views: 224
Reputation: 24776
No that is not prohibited by Grails at all and is fairly common. There is nothing stopping you from using Command objects to back your forms and base your saving/creating/etc. from and using controller names such as create
and save
.
Upvotes: 1