Re: Java servlet on browsers: dying or kicking ?
On 12/28/2012 12:14 PM, Gene Wirchenko wrote:
On Fri, 28 Dec 2012 11:07:31 -0500, Arne Vajh?j <arne@vajhoej.dk>
wrote:
[snip]
I don't think there is much point in implementing all the business
logic twice - server side in Java and client side in JavaScript. That
would be an awfully waste of money.
But I think I know what you are thinking about. You are talking about
data input validation.
Exactly.
There are good reasons to do that both client side (for smooth UX) and
server side (for security).
Exactly my point.
But the overlap between data input validation and business logic
is pretty small. Most business logic is not data input validation.
And a big chunk of data input validation is really UI and not
business logic.
True. I am tired of Web pages that could catch entry errors, but
do not until I have finished a whole page. It seems that a lot of
people ignore putting any validation in the front-end. I would like
people to think of putting code in both places.
It is generally accepted as a best practice, but I am sure
that it is still missing many places.
But unless server side is node.js or using a smart framework, then
it do means replicating code logic.
Regarding smart frameworks then ASP.NET MVC can generate both server
side and client side checks from same rules (annotations on data class)
and the same can certain JSF 2 implementations using JSR-303 annotations
(Richfaces is one such implementation).
Arne