com.rshtech.func
Interface BusinessFunction

All Superinterfaces:
Function, UndoableFunction
All Known Implementing Classes:
AbstractFunc

public interface BusinessFunction
extends UndoableFunction

Interface for business function enclosures to implement. Implementations should consider making the execute() method automatically calling the checkSecurity, validate, and checkBusinessRules methods and then performing the work of the function. Regardless, this work performed by this method is intended to be executed after checkSecurity, validate, and checkBusinessRules have been executed.

Version:
$Revision: 3137 $
Author:
$Author: kostya $

Method Summary
 void checkBusinessRules()
          Check any business rules associated with this business function, throwing a BusinessRuleException if any rule is violated.
 void checkSecurity()
          Verify the security requirements of this business function have been met, throwing a SecurityException if they have not.
 void validate()
          Validate that any data inputs supplied to the business function meet the minimum data integrity requirements of the function, throwing a ValidationException if they do not.
 
Methods inherited from interface com.rshtech.func.UndoableFunction
isUndone, undo
 
Methods inherited from interface com.rshtech.func.Function
execute, getResult
 

Method Detail

checkSecurity

void checkSecurity()
                   throws SecurityException
Verify the security requirements of this business function have been met, throwing a SecurityException if they have not. This method should be called before the validate, checkBusinessRules, and execute methods, but order depends entirely on the implementation.

Throws:
SecurityException - if the security requirements have not been met.

validate

void validate()
              throws ValidationException
Validate that any data inputs supplied to the business function meet the minimum data integrity requirements of the function, throwing a ValidationException if they do not. This method should be called after checkSecurity and called before the checkBusinessRules and execute methods, but order depends entirely on the implementation.

Throws:
ValidationException - if the data inputs do not meet the data integrity requirements of this business function.

checkBusinessRules

void checkBusinessRules()
                        throws BusinessRuleException
Check any business rules associated with this business function, throwing a BusinessRuleException if any rule is violated. This method should be called after checkSecurity and validate and the execute method, but order depends entirely on the implementation.

Throws:
BusinessRuleException - if any business rule associated with this business function is violated.