Main content area

Drupal 8 - first impressions (part 1)

The long awaited stable version of Drupal 8 has finally been released. During this adaptation period, I will comment on my experience with Drupal 8 in a series of blog posts.

What's New?

We have employed a Drupal CMS on several of our customers’ websites and have a huge amount of experience in Drupal 5/6/7. We have successfully executed migration tasks from lower to higher Drupal versions.

The announcement of Drupal 8 means that we have to quickly adapt with the new framework and offer complete solutions to our customers.

During this adaptation period I will comment on my experience with Drupal 8 in a series of blog posts trying to answer the elementary questions:

  • “Is it worth the wait?”
  • “Are the new Object Oriented and Symfony related gismos making the developer’s life any easier?”

Features For Site Builders And Content Editors

Drupal 8 advertises 200 really promising new features, including those to enhance and ease site builders and content editors, such as:

  • Native HTML5 support
  • Responsive themes In place content editing
  • Extended use of fields in more types of content
  • Views embedded in core

Features That Solve Common Developers' Problems

Other new features which solve common developers’ problems like interoperability with other systems, quick compilation of high level layouts and easier configuration deployment from development to live server, include:

  • RESTful web services API
  • Twig based theming engine and configuration management

The Most Significant Changes Are Under The Hood

Drupal 8 is built using as backbone several of Symfony2 components (essentially php libraries). Shortly speaking the symfony2 components employed in Drupal 8 are:

  • Class Loader: Provides tools to autoload classes and cache their locations. In Drupal 8 class are loaded using the PSR-4 naming standard.
  • Routing: Maps Http requests to callbacks functions and defines the access permissions. Essentially this provides the replacement of hook_menu() functionalities.
  • EventDispatcher: Provides all the necessary tools to enable components communication by dispatching events and listening to them. This has already replaced some of the hooks in Drupal and is rumored to replace the hook system in future Drupal versions. Here is an excellent article to understand how event dispatching works in Drupal 8.
  • HttpFoundation: Defines and object-oriented layer for the HTTP specification. Essentially this is the component that enabled web services in Drupal.
  • HttpKernel: Provides a structured process to convert an Http Request to an Http response using the EventDispatcher component.
  • DepedencyInjection: Standardizes and centralizes the way objects are constructed in the application. Essentially this is a way of structuring the code using a service oriented architecture. To further understand services and dependency injection in drupal I would suggest reading these articles, 'Service Container' and 'Services and dependency injection in Drupal 8'.
  • Serializer: Handles the transformation of objects to other formats like XML, YML, Json and the other way around.
  • YAML: Handles the parsing of YAML string to PHP arrays and the other way round.
  • TWIG: Twig is a template engine for php. Although it is not a Symfony component is part of the stack of the Symfony framework.
  • Translation: Provides the set of necessary tools to internationalize Drupal.
  • Validator: Provides tools to validate classes.

In addition Drupal 8 employs a set of third party libraries that are not part of Symfony framework but usually go hand in hand with Symfony like composerdoctrine annotation reader (not the ORM part), phpUnit testing framework, Guzzle http client to handle drupals’ http requests and Assetic that is used to package JS and CSS assets.

Some lasting thoughts...

How will all of these affect our work as Drupal 8 developers and how easy is to adapt our skills to the newcoming object oriented principles?

Will the experience with Symfony decrease the learning curve of the new API?

To answer these questions we have to get our hands dirty and initiate our first Drupal 8 task which is to Migrate Cookie Control Module for Drupal 8.

This will be the main subject of my next blog. So stay tuned…

Take a look at our web design and development services to see where we can help. 

Get in touch to see how we can help with your next project