Symfony Tips #14 - Separate your application in modules
🖥 Symfony Tips: Quick and practical tricks to develop solid backend systems.
What if your app keeps growing and growing? Then it can be a good idea to split it into modules.
This is OK
This is better
First change the top level folder and update services.yaml
Then move your entities and change doctrine.yaml
Finally move Repositories and update all namespaces.
Now we have our module divides in Domain, where our entities live, Aplication for our Use Cases and Infrastructure for our external services (like the database)
Now each module can grow independently and maybe even extract it to an external service.
You can run php ./vendor/bin/phpunit to run the tests.
Symfony tip completed 👍! Check the final code and leave a ⭐️!
Next Tip -> Symfony Tips #15 - Dispatch Domain Events
Previous Tip -> Symfony Tips #13 - Do validation in your setters