O'Reilly logo

Drools JBoss Rules 5.X Developer's Guide by Michal Bali

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Validation service

All rules are implemented the unit tests, and we can write a validation service that our clients can access. It will define one method for validating a customer. This is the BankingValidationService interface:

/**
 * service for validating the banking domain
 */
public interface BankingValidationService {
  /**
   * validates given customer and returns validation report
   */
  ValidationReport validate(Customer customer);
}

Code listing 21: Banking validation service interface

The interface defines one method that validates a Customer object and returns the ValidationReport interface. Since, in our domain model, all objects are accessible (traversable) from the Customer object, it is sufficient to just pass this class as the method parameter. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required