Building for Extensibility -- A look at Drupal 8's Plugin API


Prior to Drupal 8, the most common way that a developer would make sure her/his module was extensible was by adding a "hook". While Drupal 8 still makes use of hooks in many places, there is a better way to do things. Actually there are two better ways to do things:

Writing an Event Dispatcher
Making your module "pluggable"
In this presentation I will give you an overview of the Plugin API. If you're looking to learn about writing an event dispatcher, you'll have to go to a different talk.

We will look at examples of plugins in Drupal core, focusing on the high level concepts that are involved. If time warrants, and there is interest, we may even look at a simple custom example.

Oh, and I will also make brief mentions of Drupal hooks and event dispatchers just as a point of reference.

Attendees of this session will leave with an understanding of:

Defining a plugin manager
Using Annotations
Defining your plugin namespace
Instantiating plugins
Using config (entities) to determine which plugin to use
We will not be discussing Plugin Contexts or Plugin Derivatives. Though we will definitely be looking at some code, we will not be getting too down and dirty with code level technicalities. This is a beginner level presentation and you may feel comfortable attending even if you don't have any experience writing custom modules. If you are expecting to leave the presentation as a Plugin expert, then you will want to make sure that you entered the presentation that way.

Drupal is a registered trademark of Dries Buytaert.