Back Button PHP

Design Patterns in PHP

A design pattern is a common solution to a common problem. Nothing more, nothing less. And, while some of these approaches might seem foreign or overwhelming to you, the important thing to remember is that, as a developer, you are in charge. That means you decide when a pattern is appropriate, and when it's completely unnecessary. That's the key.

Advanced
Difficulty
8 episodes
1:43:02 hrs
Start Series
    1. Run Time 10:32 Free

      A decorator allows us to dynamically extend the behavior of a particular object at runtime, without needing to resort to unnecessary inheritance. Let me give you a demonstration.

    2. An adapter is one of the easier design patterns to learn. The reason why is because you use them in the real world all the time! In this lesson, let's review a handful of examples to figure out how it all works.

      View the source for this lesson on GitHub.

    3. I bet you've used the template method design pattern on multiple occassions without even realizing it! This is an easy one to understand. Let's dig in.

    4. Run Time 10:04

      Let's talk about the strategy design pattern and polymorphism. Like many patterns, you may find that you already use this one! You just didn't know that it had a name!

    5. The chain of responsibility pattern is definitely an interesting one. It literally allows us to chain any number of objects, where each has the option of either handling a particular request, or deferring to the next object in the cycle.

    6. Though certainly not for everything, you may find situations where the specification pattern can prove to be exactly what you need. In this lesson, we'll review the core concept, while using TDD and PHPUnit to drive our code.

    7. In the previous lesson on the specification pattern, we reviewed the core fundamentals. However, we stopped just short of figuring out how to apply this concept to database queries. Let's figure that out, while, in the process, learning how to use (and test) Eloquent outside of Laravel.

      View the source for this two-part series on GitHub.

    8. Run Time 17:06

      The observer pattern is easily one of the most popular patterns in the bunch. And, luckily, it's one of the easier ones to comprehend. Let's review the essentials, while ultimately translating this new knowledge over to Laravel's implementation (in version 5).

You May Also Enjoy...

Here are some additional series that may be up your alley.

PHP Object-Oriented Bootcamp
Beginner
Difficulty

As wonderful as Laravel is, it does assume that you have a basic understanding of object-oriented programming. If you don't, that's okay, we all were...

1:59:19 hrs
Play
PHP PHP 7 Up and Running
Intermediate
Difficulty

Slated for release in December, 2015, PHP 7 brings a wealth of new features, bug fixes, and performance improvements. If you're curious, come with me,...

28:25 mins
Play
PHP SOLID Principles in PHP
Advanced
Difficulty

SOLID represents a series of guidelines that developers can use to, if done well, simplify and clarify their code. While certainly not laws, understan...

57:12 mins
Play
Laravel Let's Build A Forum with Laravel and TDD
Advanced
Difficulty

A forum is a deceptively complex thing. Sure, it's made up of threads and replies, but what else might exist as part of a forum? What about profiles,...

19:29:26 hrs
Play
PHP PHP Bits
Intermediate
Difficulty

Because our industry advances so quickly, it's far too easy for bits and pieces to fall through the cracks. Each episode in this series provides a sta...

31:49 mins
Play