Ted Bowman's picture

As a contrib module developer that is starting to delve into Drupal 8 I wanted to share my experience working with Drupal 8. This is a video of me going through the process of re-creating the contrib module Token Conditions that I had created the week before. Along the way I delve into some new systems in Drupal 8 and give examples of how to figure out how to add functionality to this vastly changed version of Drupal.  

I have included some of my thoughts on the process below the video. So take a seat on the couch and grab some popcorn, its a long one.

 

As a former Java developer who remembers coming to Drupal 5 and thinking "What the heck is going on here?" I am enjoying the challenge  of getting back to object-oriented programming and  learning something new in Drupal 8.

Here are my two big takeaways from starting to work with Drupal 8:

You need to learn Object-Oriented Programming 

The importance of knowing the basic concepts of object-oriented programming is much greater than in Drupal 7. In Drupal 7 you encountered these concepts when dealing with CTools or modules that depended on the Entity API, but in much of Drupal 7 programming it just didn't come up. In Drupal 8 you will still be able to do some basic stuff like altering a form in the same manner as Drupal 7(and before) but for most of what you will want to do as a module developer you will need to know object-oriented programming.

Because Drupal 8 is such a complex system, I personally don't think that diving into Drupal 8 is a very good way to learn object-oriented programming. It would probably be a good idea to run through some basic tutorials so that you can learn the concepts first. If you know of any good object-oriented programming tutorials please leave them in the comments

A Good IDE is your friend

A Good IDE will save you lots of time in Drupal 8. I use PHPStorm but if you are looking for free and Open Source options Eclipse and Netbeans might be good options.

The importance of an IDE really goes hand in hand with Drupal 8's shift to object-oriented programming. In Drupal 8 module development you will be extending classes provided by Drupal core. An IDE will be able to tell when you are doing this incorrectly and let you know what you will need to do to correct it.

As an example of this lets look at my experience working on the EForm module for Drupal 8 which is the successor to the EntityForm module in Drupal 7.  I have been developing this over the last year in my spare time. The classes that I am creating extend Drupal core classes such as the ContentEntityBase and EntityAccessControlHandler classes.

If I haven't touched EForm in a of couple months the first thing I will do is to pull the latest development changes from Drupal 8. As soon as I do this PHPStorm will tell me if any of the classes in EForm are now incorrectly extending the classes from Drupal core.  This is a great improvement over Drupal 7 where everything was a hook and there was no way for an IDE to know if you were implementing them correctly.

Your Thoughts?

Have you started to work with Drupal 8 module development? How has your experience been?

 

 

Comments

drupalize.me has some great videos on object oriented PHP.

Jeffery Way at laracasts has prepared a great video series on php OOP:
https://laracasts.com/series/object-oriented-bootcamp-in-php

It's directed at providing enough of a grounding to start working with Laravel, but I think it would be very applicable to Drupal 8.

Hi Ted, I'm just about to hit the play button to Chromecast on my bigger screen and enjoy learning from your recording knowing it will be 2h that will save me orders of magnitudes more time trying to figure our this from other sources.

Before that, check out https://www.dataquest.io/ which offers MOOC style object oriented developer learning. The site teaches Python and is focused on data science and other topics. I've just started there, but thus far found it to be an excellent way of learning OOP as well as the Python language which I also will have great future needs of.

Thanks for sharing your knowledge and giving me a shortcut to get going with Drupal 8.

Ted Bowman's picture

Thanks for the link I will check that out!

Other Services

Drupal Consulting

Need help with project Planning?

Are you lost trying to select modules to implement your sites functionality?

Looking to simplify your Drupal development and solve problems faster?

Are you having trouble with modules such as Views or Panels?

Six Mile Tech’s Drupal consulting provides you or your company with an experienced Drupal expert.  You will be able to eliminate hours or days of wasted time looking for a way to solve your problem in Drupal. We can get you past your current dead ends in Drupal and we can teach you to solve your problems in Drupal the right way.

Contact Us to today to Learn More

Project Mentoring

Our mentoring service provides you with guidance through all of the phases of your Drupal project from planning to deployment.  We can help make sure that you are making your Drupal website the right way from the start.  With our guidance you will avoid common costly mistakes and start making more for your time.

Contact Us to today to Learn More

 

Training Newsletter

Sign up for our Training Newsletter to hear about in person and online trainings as well as to receive exclusive discount codes.

Online Trainings

Six Mile Tech offers online trainings via Skype, Google Hangout, or a screen sharing technology of your choice. These trainings can be used for generalized Drupal trainings or to tackle a specific problem for a site you are working on.