Using the ChangeNounPart pattern to validate a noun part
Each changeable part of a noun is managed by special command type called a ChangeNounPart command. This command provides a validate() method which you can extend or override to perform your own business logic checking to decide whether the change should be performed. The part to modify, the noun that contains that part, and control parameters are all made available to the command implementation at runtime.
Procedure
- Create a Java class that extends AbstractChangeNounPartUsingBusinessObjectMediatorCmdImpl and implements the ChangeNounPart interface that is associated with the Change controller command.
- Implement the
validate()
method if specific noun part validation is required before the noun part is changed. - Register your command implementation.