Design Patterns: Guides and Practical Know-how | Page 11 | mironsoft Blog
Design Patterns
-
Jul 19, 2025
A dynamic proxy class stands in for a real object and intercepts method calls before they reach the actual object. With __call, eval()-based code generation and reflection, you can build proxy classes in PHP that enable lazy loading, logging and access control, without touching the class itself or pulling in a complete ORM.
-
Jul 19, 2025
Design patterns are often explained tied to a specific framework, yet they are named, reusable solution shapes for design problems that show up in any object-oriented PHP codebase, regardless of whether a framework is even involved. This article presents the most important classic design patterns, Factory Method, Singleton, Decorator, Strategy, Observer and Repository, using nothing but plain PHP 8.4, organized by the three classic GoF categories Creational, Structural and Behavioral. No Magento, no Symfony, no ORM tie-in, just the mechanics of the patterns themselves and an honest assessment of when the extra code actually pays off.
-
Jul 18, 2025
How does Magento 2 process every HTTP request? Bootstrap, FrontController, router chain, URL rewriting and action classes, the complete path fully explained.
-
Jul 14, 2025
A plain validation function that only returns true or false discards the one piece of information it just gained through the check, and forces the rest of the code to repeat the same check at every other point. This article explains the parse, don't validate principle and shows, through refinement types, nested parsers, and practical TypeScript examples, how to permanently remove unknown states from a codebase instead of re-checking them over and over.
-
Jul 10, 2025
Feature flags in React apps decouple the question of when code gets deployed from the question of when a feature actually becomes visible. Instead of risky big bang releases, new functionality can be rolled out step by step, to specific user groups, or switched off instantly with a kill switch, all without a new build.
-
Jul 9, 2025
The visitor pattern separates operations from the class hierarchy they operate on, so new operations can be added without changing existing data classes. Using an abstract syntax tree as an example, this article shows double dispatch, the visitable interface, and the limits of this approach in PHP 8.4.
-
Jul 8, 2025
Docker Swarm and Kubernetes solve the same core problem, running containers reliably across multiple hosts, but with completely different operational effort. Teams that base the decision purely on how popular Kubernetes is often build in unnecessary complexity that nobody actually needs day to day.
-
Jul 7, 2025
Feature flags separate deploying code from activating a feature for users. In Vue apps, this becomes a powerful tool for gradual rollouts, A/B tests and fast rollback in case of errors, provided the composable architecture, type safety and cleanup discipline are considered from the start.
-
Jul 6, 2025
Symbol.iterator is the best known well known symbol, but far from the only one. This article shows how Symbol.toPrimitive, Symbol.hasInstance and Symbol.toStringTag precisely control the behavior of custom objects during type conversion, instanceof checks and debug output, and how custom symbols enable collision free object keys.
-
Jun 29, 2025
A data table with hundreds of rows decides the productivity of an entire team. Building Tailwind CSS data tables without zebra pattern, sticky header and clear sort indicators forces users to count rows with their finger on the screen. This article shows concrete styling patterns for data tables that stay scannable even with large amounts of data.