The next two examples show how we can simplify our code by using support for the observer pattern that is built into the wonderful Spring4D library (https://bitbucket.org/sglienke/spring4d).
Both programs that I'll present—SpringObserver and SpringMulticast—require the Spring4D library to function. To run any of them, you'll have to install this library and then add its folders, Source and Source\Base, to Delphi's Library path or to the project's Search path. If you unpack the library into the Chapter 7\Spring4D folder, the project's Search path will already be correctly configured and you can simply press F9 to run the program.