Nodes and the Visitor pattern
– lorisleiva.com - submitted by Loris
Learn why, when and how to structure your data as a cluster of nodes and how to execute various operations on that cluster via external visitors.
Read more [lorisleiva.com]
Posts tagged with design patterns
– lorisleiva.com - submitted by Loris
Learn why, when and how to structure your data as a cluster of nodes and how to execute various operations on that cluster via external visitors.
Read more [lorisleiva.com]
– 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]
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"Always fresh, useful tips and articles. Carefully selected community content. My favorite newsletter, which I look forward to every time."
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]
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]