In this chapter, we'll look at building a decision service for validating a domain model. By writing a set of rules, we'll be separating the validation logic from the rest of the system. This set of rules can be then reused in other systems. For example, it may not only be used as part of the service layer in a web application, but also as a part of high performance batch application for processing large volumes of data.
Before we start with validation, we'll define a simple banking domain model that will be used in examples throughout this book.
The following figure shows the UML diagram of a simple banking system. It defines four entities:
Every bank needs a ...