User Interface validations in web applications are done either on the server side or on the client side. The design design decisions are made by the design team of the project.
In server side validations, each screen will have a server side component in the form of a request handler that will perform the validation as the first step in request handling. The validation will be a series of nested if statements to would perform validations in the appropriate order.
if (condition-1)
{
if (condition-2)
{
.
.
}
}
else if (condition-3)
{
.
.
.
}
else if (condition-4)
{
.
.
.
}
This approach allows each developer to define validations specific to the screen and define the order in which the validations must be carried out.
The disadvantages to this approach are
Large amount of if-else code: A typical application can potentially have about 100 screens. On an average, if each screen has about 5 fields, then the amount of if then else is atleast 500. Thus there are 500 opportunities for developing buggy code.
Bug fix turnaround time: As explained above, bugs are inevitable in this approach. The problem is that to fix each bug, the code has to be changed and then promoted through the various levels of testing and approval before finally deploying on the production system.