Rafał Baran | PHP | 25.02.2020
In my daily job as a PHP software developer I like to use frameworks because they are the result of community collaboration – so I don’t have to solve problems that have already been solved and focus on higher application layer. But at the same time every user, including me, can have an impact on them.
For my technology there are many frameworks available on the market so it’s not difficult to choose the most convenient for the particular project or individual preferences. But let’s take a look at all areas of programming where frameworks can be used.
The areas where we can use frameworks in IT are:
On today’s software market we have many ready-to-use solutions, and most of them are based on frameworks, because they have to keep architecture at a high level of clarity and formalization to enable software developers to make further modifications. This features a high level of complexity, but it is worth learning new technologies and solutions because they can accelerate your work or that of your team. Let’s consider it in even greater detail and take a look at the list of pros and cons of frameworks.
Read also: Clean Architecture
As we can see, we have more pros than cons, which in my opinion is the biggest advantage of frameworks. However, we have to be aware that frameworks are not always the best solution. For example, if we need to create an application to display a single message on screen as a server response, the usage of frameworks will slow down the server response and the execution of our application. Such an application needs only one command to execute and no additional tools are necessary.
Of course, I wouldn’t say that frameworks can resolve all our problems with software, but they can certainly help us with our daily tasks. On the other hand, we have to be careful here. Too many times I’ve seen fights on community forums dedicated to a given framework, where people try to prove that the framework which they have chosen is the best.
I believe that frameworks are like tools – the more tools you have, the more problems you can solve. If you only have a hammer, you can probably only hammer a nail. But if you have a shed full of tools you can do whatever you want.
This approach is supported by the architecture of today’s applications, which are built from packages – separable modules with their own requirements that we can use to create any kind of application. That way, the application can be divided into smaller parts and is easier for more people to understand. Packages also organize the structure of applications and help to develop larger projects.
According to this idea, we can use packages as independent software and install them to build our application. There is no obstacle to the use of frameworks in the same way – each part of our application can be built on a different framework. Why? When we use libraries created for only one framework, we are not able to utilize software created for other frameworks. In summary – we should use the approach that allows us to remain open to other possibilities: the multi-framework approach.
The multi-framework approach can be seen in popular solutions like Magento (e-commerce platform), Sylius (e-commerce platform) or next generation e-commerce shop which calls Shopware, there is a not only e-commerce application – where we can see it, also at popular and highly flexible CMF frameworks such as Sulu. When you check the source code of these applications on GitHub, you will see that the authors have used packages from Zend & Symfony frameworks – those packages are manageable in PHP technology via a composer service. The proportions aren’t huge at first glance, but we can start to consider it a multi-framework usage and treat is as a conscious architectonic decision.