An introduction to OOP via a Drupal 8 lens

May 13, 2015

I posted this on twitter a while ago, and sadly only just got around to saving it to my own website, so apologies for those that have already seen it.

Earlier in the year (around Drupal Camp London time) I decided I wanted to actually dedicate some time to properly getting an overview of Object Oriented Programming. I have used elements of OOP before when extending objects, particularly any part of the cTools Drupal module suite. But I just wanted to understand more of theNomenclature used when developing a brand new item within OOP. At the London Drupal Camp there was a great talk on OOP which introduced a lot of interesting areas, some of which I already knew, others were new to me, such as class, object, property, method, trait, interface, abstract class etc.

So, what was the next step in this, well I wanted to see how OOP was going to be used in Drupal 8, and use that to learn better OOP naming and standards. And thus the attached pdf document was born. It just introduces a few of the concepts mentioned earlier, and also shows, using PHPstorm, the inheritance tree for a node. I hope it is of interest to others, and if anyone wants to suggest improvements, feel free to message me on twitter @retrodans.