Source: matthiasnoback.nl

DDD and your database

Category: PHP

Posted on May13th2020 by Matthias Noback We're not even discussing CRUD in this article, which apparently is the worst of the worst).

In a previous article (Is all code in vendor infrastructure code?) I've shared my definition of infrastructure code and we discussed a more practical definition as well: infrastructure code is code that is not sufficiently isolated to test it with a unit test.

In a unit test you can just do this: So none of this code is infrastructure code, although those annotations are definitely meant to support persistence and you could say this class has "infrastructure concerns".

Actually, if you're migrating to a different ORM, having a good set of integration tests will save you, and it doesn't really matter where the code is that needs to be migrated.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners