Article
PHP Patterns with more practical examples
As a developer, understanding design patterns and being able to use it, is kinda of cool 😎, but the hard part is to know when to use it and which pattern to use. Lets look at some easy practical examples.
Every developer has been there, done it. It is frustrating at the beginning, reading about design patterns and looking at examples on the internet at first seems like, great i get it, its easy right? But when it actually comes to applying it in your own project, you’re lost, confused that all of a sudden it seems like all the design patterns are similar and you don’t know which one to apply. Don’t worry you’re not alone. In this article i’ll do my best to show some practical usage.
What are we looking at?
This will be a multipart series where i will explain the most commonn patterns and some Object Oriented Patterns / Principles that will help you write clean and extendable code.
I won’t bother explaining the different categories (creational, behavioral etc.) of design patterns here, there are plenty of resources on this. We’ll just dive straight into the patterns.
General OOP patterns
- Classes (Objects)
- Interface
- Abstract Classes
- Fluent chaining API’s
Design Patterns
- Factory
- Strategy
- Observer
- Template
Hope you find this article useful 👍.