Google
Webwww.sanchivi.com
The User Interface Validator Pattern

Motivation

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