Drupal 8 Wins: Avoiding the Dead Hook Blues, Part 3




Acquia Inc. podcasts show

Summary: Drupal 8 Wins: Avoiding the Dead Hook Blues, Part 3 - Today we wrap up this mini series with Larry Garfield, Kris Vanderwater, and me answering the question "Do I need to learn Symfony to develop for Drupal 8?", getting the lowdown on plugins, and doing a wrap-up on the important points from our whole, 3-part conversation. In August 2013, I spoke with Larry Garfield and Kris Vanderwater in a 90+ minute live Hangout on Air about the origins, details, and implications of the big architectural changes coming in Drupal 8. Today's video and audio podcasts are the third set of "curated" excerpts from that long conversation. In part one, we covered Larry and Kris's Drupal backgrounds, early Drupal memories, compare Drupal 4 to Drupal 7 and 8, some pragmatic reasons to choose Drupal, and how to get your head around the Symfony2 framework. In part 2, we went over the Go PHP 5 project as the first seeds of cooperation between different PHP projects, how the Symfony2 framework became part of Drupal 8, why we aren't building Drupal 8 on Symfony full-stack, and CMI, abstraction in Drupal, and the future of Features in Drupal 8. Symfony2 != Drupal 8 Q:"If I'm not familiar with Symfony, will I have a hard learning curve for Drupal?" A: Larry Garfield - "Adopting various Symfony components has had a huge impact on Drupal, however people should not confuse the parts that are done with Symfony versus the parts that are done with PHP 5.3. PHP 4 and PHP 5.3 are different languages: conceptually, structurally; they happen to be mostly backward-compatible, but that's about it. Drupal 8's biggest shift is that it is a PHP 5.3 system. We have ported Drupal to a new language. That is the biggest jump for people. Symfony is a PHP 5.3 component library that we're using a lot of pieces of to save time and because they have already solved a lot of hard problems in ways that are very good." "You don't need to know Symfony full-stack in order to use Drupal. Understanding the HttpKernel would be helpful, but you don't need to build a couple of projects with Symfony full-stack to work with Drupal. You do need to understand PHP 5.3 development: classes, objects, not using globals, dependency injection, events as a concept. These are all things that are not specific to Drupal 8 or Symfony. They are specific to PHP 5.3 and modern PHP development." A: Kris Vanderwater - "If you're a Symfony user and have used it in your projects in the past, you're going to be able to carry some of that knowledge forward. The places where we're using Symfony are in CMI, the routing system, the dependency injection container (which is awesome and you should absolutely learn it no matter what, just for your own well-being). With the exception of the dependency injection container, most of the rest of the stuff is behind various layers of Drupal stuff. You're probably not going to need to deal with it unless you absolutely have to." Beyond the dependency injection container, Kris says the only one you might need to touch would be the routing system, and you'd have to be doing something routing specific. There are Drupal wrappers around most of the Symfony components, so "the short answer is 'no', you don't need to know Symfony in order to do Drupal." Plug-ins Q from the event live chat: "Question: Plugins, plugin types, plugin managers, arrrrgh! How?" A: Kris "A plugin type is a term that we use colloquially to refer to a type of plugin ... You actually won't see that in code anywhere. You might see it in a couple of comments or something like that, but a 'plugin type' is just words that we use." "Plugin Managers are actually a class that composes together the ability to discover where a plugin exists. You can think of this in terms of hooks. Info hooks in Drupal 7 have largely been replaced by plugins in Drupal 8. So when we talk about 'discovery', that's what we mean." "Plugins are just the...