August 2018
Intermediate to advanced
524 pages
14h 45m
English
We have a consistency checker class, and an instance of it is injected into the controller. This class is used to check the consistency, but it does not actually perform the check itself. It only controls the different checkers that we provide and invokes them one by one to do the real work.
We require that a consistency checker, such as the one that checks whether the order contains a power cord when a desk-side lamp is ordered, implements the ConsistencyChecker interface:
package packt.java11.bulkorder;
import packt.java11.bulkorder.dtos.Order;
public interface ConsistencyChecker {
boolean isInconsistent(Order order);
}
The method isInconsistent should return true if the order is inconsistent. It returns false if it ...