Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where should i validate?

 
David Gibson
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys
I was going to do my validation between the gui and the call to the Data interface. My problem is if sun are going to run tests automatically with the data interface supplied in the exam then none of this validation with be run. In effect I am using the Data interface as a interface to the database file and I have a application layer(run in the same vm as the gui). It is in this application layer that I wish to do my validation
 
Andy Zhu
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IHMO, it is no hurt to validate in both client and server side, no matter which client type, thin or fat, you choose to implement. In this case, it won't affect your program when sun runs its gui front against your db server.
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David,
IMO, data validation belongs to the model layer of the application. So that, the model layer can be reusable and is not tight to its view. However, adding another validation mechanism in the view layer is helpful to not waste resources (ex. network bandwidth, and database resources). If you have time, then do it twice in the model and the view, and if you don't have time, do it in the model layer only.
 
Steve Taiwan
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my experience, when I design J2EE project, I always use java script to validate data before sending them back to server. If the validation happens in server, client has to wait and server has to waste resource for processing useless data. Therefore, in the real world, I will validate data both in client and server side. Not in either client or server side.
In my project, I will validate data both in client and server side.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic