Plugins enable us to modify system functionality without the need to alter existing code. For example, plugins can be used to alter content before it is displayed, extend search functionality, or implement a custom authentication mechanism. As an example, this chapter shows how to replace a string with an image.
Plugins use the observer pattern to keep an eye on events. It is by listening to these events that we can modify the system functionality. However, this also means that we are limited to only modifying those parts of the system that raise events.
Plugins represent the listener, and they can define either a listener class or a listener function to handle specific events.
In this chapter, we will cover the following: ...