--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
Hi Pascal,
I'm and not agree with you. Here I try to expose my view:
Because model's technology allows to express rules, my goal is to
write a model with its rules and write the code with its business
rules. Not to express rules in the model and have some of them
automatically managed by the Validation layer and some other managed
by hands. Finally you've got to manage yourself model rules in 2
places: model layer and presentation layer. It seems to me a old way
and a open door for bug.
I agree that we should write every rules and process for an
application, but when using a framework which try to separate concerns
in their own places I do not want to split and spread rules
everywhere.
Perhaps the best solution is to override JPA constraint annotations
which need some code in presentation layer, to make them managed by
the Validation engine. Like that when we decorate a model with some
@MinSize() or @Unique() we won't be afraid to forgot to add lines of
code in several parts of the application.
It's probably the way to get KISS and DRY code (Keep it Small &
Simple, Don’t Repeat Yourself)
I hope to been clear and not overbearing ;-)
Regards
Cyrille.