Message Rules Engine
Overview
The aim of this design is to go some way to providing a software component that can provide application- and situation- specific messages, in a flexible and configurable way.
The most simple-minded and least flexible way to implement the functional spec would be to code long if-then-else constructions. The most sophisticated way would be to use a full-fledged business rules product. Our design intends to fall somewhere between these two extremes, tending to the simpler end of the spectrum.
The key points of the design are:
- Usable across different applications
- Rules implemented in Java
- One Java class per rule
- Usage is flexible, determined by configuration
- Message text maintainable by users
Terms & Definitions
Rule: a condition and an action. Each rule will be tagged with a Domain and a Context attribute.
Message Rule: special kind of rule where the action results in a single message in string form.
Domain: represents an app or subject area (e.g. Online Reg)
Context: represents a situation in which messages will be retrieved (e.g. for Online Reg: Display Subject Selections; Approval; Add Subject)
The Message Rules Engine will be the software component that applications interact with to retrieve messages. An app will supply a domain, a context, and a set of input data. It will receive a list of messages appropriate for the domain and context.