Hooks & Events Overview: How Complex Systems Communicate

Event systems are a programming pattern that allow many disparate parts of complex software communicate and react to changes from other parts. Many software frameworks have some type of event system that allow the system to be extended easily. Historically Drupal and WordPress have called them "hooks", whereas JavaScript and other software call them "events".

Now with Drupal 8's adoption of Symfony framework, Drupal 8 now has two event systems in place; the older system of hooks, and the newer system of Symfony events. The patterns behind event systems are universal, and gaining a fundamental understanding of them can be significantly helpful when learning or creating new frameworks.

In this presentation we'll explore the anatomy of any event system and we'll see how these concepts are shared and applied to Drupal hooks, Symfony events, WordPress hooks, and even JavaScript events.

Learning Objectives

By the end of this session attendees will be able to:

recognize an event system, regardless of what the framework has named events
make use of the event systems in Drupal, WordPress, and JavaScript
identify the parts of an event system and understand how they work
discuss the pros and cons of the most popular frameworks' event systems
Target Audience

This presentation is great for developers who are familiar with working in themes and modules and want to understand more about what is going on under the hood of Drupal.

Prerequisites

Attendees will get the most out of this session if they have written/implemented at least one hook or JavaScript event before, regardless of level of comfort with doing so. jQuery click handlers count! Copy and paste is totally okay.

Jonathan Daggerhart
Architect at Hook 42
Long time Drupal and WordPress developer. Organizer of Drupal Camp Asheville.

https://www.fldrupal.camp/sessions/development-performance/hooks-events-overview-how-complex-systems-communicate

Drupal is a registered trademark of Dries Buytaert.