I would like to follow the recommendations of this article from Sander Mak, which advocates using a traditional Monolithic Architecture making use of modules instead of Microservices which are not a good choice in many cases : https://www.oreilly.com/ideas/modules-vs-microservices
I made lot of researches on Monolithic versus Microservices and came to the same conclusion that Monolithic is still the best bet in many cases and the same goals can be achieved in a much simpler way. Microservices should be used in really extreme and specific cases.
Of course the implementation of a good Modular Architecture is different in every language & frameworks. The author is speaking about Java 9 and how it has redefined completely the way of implementing such a Modular Architecture.
But what about Symfony 4 ? Prior to version 4 it seems that the right approach was to use Bundles. But since the version 4, the official documentation is clearly recommending to not do that anymore : https://symfony.com/doc/current/bundles.html
In Symfony versions prior to 4.0, it was recommended to organize your own application code using bundles. This is no longer recommended and bundles should only be used to share code and features between multiple applications.
But I could not see in the documentation what is the right way to do it now! If Bundles cannot be used, what would be the best practices then to implement a Modular Architecture as defined in the article of Sander Mak ?
I am my self from Java environment, but have choose to write my current applications in SF4/PHP-7.x environment. Many reasons that are very long to enumerate here have made me choose SF4, after Laravel 5.x.
Don't be fouled by the Symfony 4 and 5 moves ... I admit I don't always understand all their evolution plan and marketing strategy, and I was frustrated at the start with the new bundle less application orientation announce. But instinctively, and maybe because I didn't have other choices, I strive to try SF4 with the convinced plan to reinforce my application modular strategy in the SF4 environment.
Thanks to the Sander Mak article on Modules vs Micro-services, in that it confirm my needs of for a modularity support framework, more than micro-services modular functionalities. The real stake here is to correctly evaluate what type and scale of organizational concepts you want to implement as modules. Modularized micro-services can surely be used to implement complex hardwares, business activities and detailed organization infrastructures. But at a heavy cost, and with many resources to deal with the dependencies and inter-connexions.
With SF4, although they usually spoke about micro-kernel, or build your own micro-service framework, I see their offer as a good monolithic platform, to build modular business applications. I admit the PHP OOP limits compared to java environment, make some implementations harder than desired, but at the end, for regular business applications requirements, the SF4 framework and components offer a good application basement.
Before diving in the best way to use SF4 for modular application dev, I will share my understanding of SF4 leaders vision / road map, for the next 2 years :
Starting with the SF4 bundle less environment, Symfony leaders decided to drop the AppBundle, because by experience, they know the overhead of creating a bundle versus a component module. So, the 'App' default component application is now the base environment to offer many solutions in one to application architect:
My recommendations for internal modules priority :
When time comes, and you want to share a particular module with the community, check to send back to the module, the minimal config/parameters required in external environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With