php[architect] logo

Want to check out an issue? Sign up to receive a special offer.

PHP is Standing Tall

January 2023

Happy New Year from everyone here at PHP Architect. We hope that you are ready to make 2023 your best year yet, and we want to be a HUGE part of your journey.

Domain Logic in One Place

By Stathis Georgiou

In this article, I want to examine one of the most common problems I have faced while working on many applications, legacy or not. I will also suggest an alternative solution, but first, I will need to lay out why I think this is happening and what we could look out for to avoid it in the first place. I am unaware of an official name for this phenomenon; however, I call it “scattered business logic”. It simply means that the business rules which describe the problem and its solution often are spread out in multiple files and even technologies instead of being in one place. by Stathis Georgiou

Data Mapper Pattern

By Alexandros Gougousis

ORMs are great for Rapid Application Development. You can get started very quickly. The price you pay is the vast complexity they hide under the hood. As your system grows, that complexity can bite you if you are not careful enough. Moreover, ORM packages create heavy objects that can make your life hard when doing batch processing. Knowing the basic principles and challenges when mapping an object to a relational database is a great blessing. This knowledge will help you make some important decisions as your application grows. by Alexandros Gougousis

PHP Puzzles: Any Two Birthdays

By Oscar Merida

Working with dates and times is fraught with peril, so it helps to practice manipulating such data. We’ll have to be wary of how to calculate differences between dates, potentially deal with leap days, and other irregularities. by Oscar Merida

Education Station: Monolith vs Microservices

By Chris Tankersley

Which should you use…Monolith or Microservices? Neither is better or worse, so let’s look at them more closely to figure out which will work for you. by Chris Tankersley

The Workshop: Upgrading with Reckless Abandon Part One

By Joe Ferguson

This month we’ll dive into upgrading a PHP 7.1 application originally built with the Laravel framework version 5.6 with reckless abandon. The only way this kind of upgrade can succeed is with a robust suite of tests. Tests allow us to leap major versions of our framework and dependencies and even PHP versions in some cases. Without a strong test suite, we couldn’t possibly have the confidence to jump versions without thoroughly testing each change manually. If you’d like to jump versions for your projects, ensure you start by writing as many tests as it takes to provide confidence in major structural changes. by Joe Ferguson

DDD Alley: Try, or Try Not; There is no Do

By Edward Barnard

The past two months focused on transactional-consistency boundaries. This month we’re extending the concept to RESTful API requests and responses. We’ll ensure that responses are internally consistent, whether success response, or error response. We’ll carefully draw and enforce the consistency boundary using the ancient wisdom of Yoda. by Edward Barnard

Security Corner: PCI-DSS: A Beginners Guide

By Eric Mann

Every developer should strive to not only build a quality application but also to ensure that security is baked in at every phase of development. Applications handling customer payment information are even more critical to secure. Firstly, it’s just the right thing to do to ensure that you handle customer payment data appropriately. But if you want to work with credit cards, you’re explicitly required to follow a set of standardized guidelines: PCI-DSS. by Eric Mann

Artisan Way: Standing Tall with the Laravel TALL Stack

The TALL Stack is a collection of frameworks for building interactive applications with Laravel. Let’s take a closer look at the TALL stack – T(Tailwindcss) – A(Alpine.js) – L(Laravel) – L (Livewire). by Matt Lantz

PSR Pickup: PSR 14: Event Dispatcher

By Frank Wallen

As the title states, what PSR-14 is truly about is an Event Dispatcher. This is what sends out the Event into the system. We’re also going to talk about Events and Listeners, as the dispatcher would have nothing to do without them. by Frank Wallen

finally{}: Self-worth

By Beth Tucker Long

As the new year dawns, the snow is flying (at least where I am), and so are the resolutions. I can’t even count how many emails I have gotten from companies about how they can help me stick to “my resolution” to lose weight, exercise more, read more books, learn a new language…the list goes on and on. by Beth Tucker Long

Leave a comment

Use the form below to leave a comment: