Discussion about this post

User's avatar
JP's avatar

The pragmatism angle is spot on. I've found the port interface pays for itself almost immediately when you're dealing with external vendors though. In Laravel the Illuminate\Contracts namespace is basically a port layer, and every time you swap a MAIL_MAILER or QUEUE_CONNECTION in .env you're swapping an adapter without touching domain code. The ceremony is minimal but the freedom to switch providers is real. Covered this with payment gateway, search, and SMS examples here: https://reading.sh/the-architecture-pattern-that-makes-vendor-lock-in-optional-48e485cb4f03?sk=6928cb411cc2400f69ddb85023cf1f7f

No posts

Ready for more?