When Objects Aren't Enough
– www.tonysm.com - submitted by Tony Messias
Tony Messias been looking up resources on the roots of Object-Oriented Programming. He shares some very interesting ideas.
Read more [www.tonysm.com]
Posts tagged with design patterns
– www.tonysm.com - submitted by Tony Messias
Tony Messias been looking up resources on the roots of Object-Oriented Programming. He shares some very interesting ideas.
Read more [www.tonysm.com]
In this post, Kai takes a look at how you can write tests to ensure consistent behavior across all implementations of an interface.
Read more [www.kai-sassnowski.com]
Join thousands of developers
Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.
No spam. Unsubscribe anytime. You can also follow me on X.
A pattern that has come up a few times Vera's my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property. Essentially, the expression functions as a default value.
Read more [lea.verou.me]
Here's an entire chapter taken from Front Line PHP, a course on building moderns apps with PHP 8
Read more [front-line-php.com]
– ryangjchandler.co.uk - submitted by Ryan Chandler
Sometimes your controllers can get rather large, especially if you have lots of conditions and data formatting. Have you ever considered moving some of that complexity out into a dedicated response class?
Read more [ryangjchandler.co.uk]
Here is the recording of Laravel Worldwide Meetup #3. Jazz Jalled spoke on the manager pattern, Adel Fayzrakhmanov on PhpStorm plugin development.
– ryangjchandler.co.uk - submitted by Ryan Chandler
Laravel makes use of the internal Pipeline class and it's more common in userland too, but have you ever considered tidying up these pipeline processes with custom pipeline classes?
Read more [ryangjchandler.co.uk]
Bruno Falcao explains a nice strategy when creating resources in Nova
Read more [stitcher.io]
The usage of phantom types is a simple type level trick which can help with this in practical settings, without requiring complicated features or making your code too abstract and less readable.
Read more [marcosh.github.io]
Jason McCreary makes the case for using traits over reaching for inheritance.
Read more [jasonmccreary.me]
A nice way of structuring an app and good example of handling multitenancy in a light way by the Tighten team.
Read more [tighten.co]
Mohamed Said explains an interesting pattern for you to consider that can potentially make authenicating from the frontend easier.
Geepaw Hill explains a way to avoid demeter violations.
Read more [www.geepawhill.org]
– liamhammett.com - submitted by Liam Hammett
A static constructor is just a method the developer can define on a class which can be used to initialise any static properties, or to perform any actions that only need to be performed only once for the given class. The method is only called once as the class is needed.
Read more [liamhammett.com]
– stitcher.io - submitted by Brent
In this two-part series, my colleague Freek and I will discuss the architecture of a project we're working on.
Read more [stitcher.io]
– driesvints.com - submitted by Dries Vints
Dries Vints wrote a bost on why he uses single action controllers.
Read more [driesvints.com]
Very nice post by Jessica Joy Kerr on the benefits and tradeoffs of event sourcing.
We can get a complete, consistent model of a small piece of the world using Event Sourcing. This is powerful but expensive.
Read more [blog.jessitron.com]
– stitcher.io - submitted by Brent
Brent explains a few patterns to add enum functionality in PHP.
Read more [stitcher.io]
In this video I demonstrate how to you can create a fluent API by using pending objects. We'll take a look at how subscribers can be created in Mailcoach. As a bonus I explain how jobs are dispatched using a pending object in Laravel.