Chapter 16. Notification

Collects errors and other messages to report back to the caller.

image

I’ve carried out some operations that made significant changes to an object model. Now that I’m done, I want to check that the resulting model is valid. I can initiate a validation command; I want to know the answer as a simple Boolean, but if there are errors I want to know more. In particular, I want to know about all the errors rather than have the validation stop at the first error.

A Notification is an object that collects errors. When a validation check fails, it adds an error to the Notification. When the validation command finishes, it returns the ...

Get Domain Specific Languages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.