Hi,
i want to implement a utility class which methods are internal steps of a validation process. Is there a pattern for this or should i use a totally different approach? Im open for suggestions. (I´m coding in abap but i dont think that is important)
Edit: Its no frontend validation of text, but a check if certain conditions are matched. (The parameter is actually a table. For each row i check if there are conditions matched as an example if there is a valid entry in an other db table.)
Somthing like this:
Class Validator
{
private bool flag_error;
private Step1 ( var a, var b )
{
//do somthing ...
}
private Step 2 ( var a )
{
//do somthing ...
}
private Step 3 ( var c )
{
//do somthing ...
}
static Check(var a, var b, var c)
{
Step1(a, b );
Step2( a );
Step3( c );
return flag_error;
}
}
Usage:
if (Validator.Check(a,b,c) )
{
//do good stuff
}
else
{
//do error handling
};