Originally posted by James Clark:
In the UI, users should not be "enabled" to enter faulty data such as a year of 1753. The UI should be designed, as much as possible, to only permit valid data entry, e.g HTML select box with only valid years. This practice reduces the amount of "validation" that may be coded in the UI.
Validation of data should be coded in Business tier code.
• Sun Certified Programmer for Java 2 Platform (SCJP2)
• IBM Certified Professional for Object Oriented Analysis and Design with UML
• IBM Certified System Administrator for WebSphere Application Server v5.0
• Certified Business Analysis Professional (CBAP®)
Therefore if the business tier does it's own validation and decides a value is incorrect for some reason (perhaps the code has been changed out of synch) it can treat the failure by throwing an exception back up.
However, since the validation is growing (for example, a single field/property of a business object could be validated for its length, correct format, and whether it is mandatory or not). This makes a few validations on the Model that I don't really know how to deal with it, from an architectural point of view.
What I mean is that, for example, a transaction is made up of different values (negative and positive). In order to be able to save a transaction, the sum of the items must be zero. This is a validation that has to do with the user interface and with the Business Layer/Model.
Originally posted by James Clark:
[QB]These concepts and issues concern object-oriented analysis & design, not architecture. Model-View-Controller is an object-oriented design pattern.
Why do you think this validation should occur in the user interface (View)?
QB]
Dadonas<br /> <br />Don't gain the world and lose your soul.
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|