General information
Category:
Object Oriented Programming
>>Hi
>>
>>In a 3-tier environment, if checking for the presence of empty fields, when a save is called, should the middle-tier validate this, or the presentation-tier?
>>
>>Thanks
>>Kev
>
>I do it in both. We need to ensure data quality, right? Consider the case of a web browser in your example, where everything generally requires a round trip. The user forgets to fill a must-fill field, and presses Submit. Then a round trip to server happens and a long wait, just to be told that you forgot to fill it. These kinds of simple validations I do at the client itself, with some simple JavaScript code to catch the most obvious mistakes.
So why bother with a middle tier?
If you put all your validation into the client, why not save a few bucks and do away with the middle tier and just go for a 2 tier environment?
The whole point of a 3 tier environment is that the presentation layer is interchangeable: either a dedicated front end, or another general purpose tool like excel. Irrepsective of the front end, with a middle tier, the business logic and data validation is respected.
In a decent setup, the data being transferred between the client and the middle tier should be minimal, so why references to a long wait????
Mace
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only