events

Drupal 9: Creating Custom Events

The events system in Drupal 9 allows for different parts of the system to communicate in an object-oriented manner. During the normal processing of a page, Drupal will trigger events that components will subscribe to in order to perform actions. The events system is built upon the Symfony event dispatcher component, which is an implementation of the mediator design pattern.

The mediator design pattern is a way for objects to communicate with each other through a mediator object (hence the name). The idea being that the different parts of the events system are never directly linked. This reduces the dependencies that objects have and allows parts of the application to be decoupled. Events are useful in a large and modular application like Drupal as it allows different parts of the application to work together without having to explicitly reference the objects involved.

Drupal7Camp Leeds 2011 This Weekend

ImageThis weekend (21st-22nd May) will be the Drupal7Camp 2011 in Leeds and I have organised myself tickets and hotel to attend. Drupal7Camp is a barcamp that is devoted Drupal 7, and so will consist of talks and sessions from the attendees. As a result the actual sessions list will not be decided until the day and will also consist of some informal discussions and workshops.

I will be representing #! code at the event (probably with my #! code t-shirt) and will be giving a session on the use of the new queues functionality in Drupal 7.