Interface Examples For Object Oriented PHP

Interface Examples For Object Oriented PHP

In this tutorial, we’ll take a look at Interface Examples while programming in Object Oriented PHP. Interfaces are one of the main building blocks of the SOLID pattern. When I first saw the word SOLID, as in someone referring to SOLID programming, I thought they meant it was solid, as in cool or legitimate. 🙂 LOL. Or course in reality, SOLID is the idea of the group of design patterns, conventions, and philosophies made popular by Uncle Bob Martin.…

Dependency Injection for Beginners

Dependency Injection for Beginners

Dependency injection is another common theme among object oriented programmers. In this tutorial, we will take a look at dependency injection, and why it might make sense to make use of it. We’ve already had a look at basic classes, objects, getters and setters, as well as some basic concepts regarding encapsulation and inheritance. Let us now tackle a gentle introduction to dependency injection and object messages now.…

Why Use Inheritance?

Why use inheritance

Inheritance is a term for reusing code by a mechanism of passing down information and behavior from a parent class to a child or sub class. It’s pretty easy to understand really. Just like a child can inherit various mannerisms and behaviors from his or her biological parents, in software this same concept holds true. By leveraging the power of inheritance and creating child classes that extend their parent, we can make sub classes with super powers that have everything their parent has and more.…

Encapsulation For Hackers

encapsulation for hackers

Encapsulation introduces yet another fancy word to your object oriented vocabulary. You might think we’re launching rockets with all the verbiage that comes along with programming in this style. In fact though, this is not rocket science at all! It is actually fairly straight forward if you simply take the time to read through some good tutorials, watch some great screencasts, and test things out for yourself.…

What are Getters and Setters?

getters and setters

Getters and Setters seem like a really long winded way of dealing with the values assigned to properties in objects. Most likely, you’ve been used to simply assigning values to your variables within your procedural code without issue. So why get all fancy in object oriented PHP and start to deal with more complicated ways of assigning and accessing the data that properties in our objects hold?…