Chris Shattuck: Developer, trainer, Drupal enthusiast, aspiring guitarist, father of two boys, and now... answerer of questions? It's time to ask Chris anything! Nothing is off limits!!
For example, if you were to ask Chris what he does to stay in tune with the Drupalverse, he would probably tell you that The Weekly Drop is a great, neutral way to keep up with Drupal news.
I bet you can come up with some better questions than that though... Head on over to r/Drupal all day long for the most awesomest Drupal AMA going on today!
5 NEW videos added in "Drupal 8 Developer Prep"
How inheritance allows for abstraction of concepts, and how that can make code difficult to understand - 2:18
Inheritance allows us to separate out ideas in our code and create a hierarchical structure from those ideas. This is powerful, but often leads to abstract concepts that can make understanding our code more difficult than what you might be used to with procedural programming. There's no way around it, but if you feel overwhelmed by the abstract ideas that arise from structuring your code this way, it's important to know that you're not alone.
How to use an "interface" for defining inherited class structure - 4:36
With inheritance from a normal class, we don't get a lot of control over how that child class is structured. In this video we look at the benefits of using an "interface", which allows us to create a scaffolding which child classes have to match up with. Drupal 8 uses interfaces extensively, so it's good to get a feel for how they work.
How and why to use an abstract class - 3:20
The final method we can use to inherit behaviors from other classes is to use an "abstract class". These classes are like a combination between classes and interfaces, with the benefits of each. In this video we walk through how we would adjust our example to work with these.
(FREE!) What a public interface or API really is and how OOP helps make an API more explicit - 3:28
An important thing to understand about your code is that you're always creating an API, even if you didn't build it to be one. You'll use the code later, and other people might plug into a project and use that code as well. The more explicit about how you expect your code to be used, the fewer communication problems you'll have in your code later on. In this video we talk about this idea a bit.
The difference between the "public", "private" and "protected" visibility settings - 4:07
One way we can define our public interface or API is to be explicit about how and when we expect people to use the methods and properties in our classes. We looked at using the "static" keyword, which is one component of this, as well as the different forms of inheritance that we can define. The final aspect we'll look at now is using visibility settings to set whether instances and child classes can use methods and objects in the parent class.