In recent years, we have slowly begun to adopt a code better and better written, little by little. We are finally starting to switch to something that looks like SOLID, but we are not there yet. Since the move to the act, one of the biggest grievances of developers is that they do not support peer review and crossing dozens and dozens of files while; each task previously required only the developer who handles 5 to 10 files.
Before we started making the change, our architecture was organized in the following way (granted, with one or two orders of magnitude more):
- Entities (database entities)
- Models (domain models)
- user interface
As for the files, everything was incredibly linear and compact. There was obviously a lot of code duplication, tight coupling and headaches, however, everyone could go through it and solve it. Complete novices, those who had never opened Visual Studio as much, could understand it in just a few weeks. The lack of overall file complexity makes it relatively simple for novice developers and new recruits to start contributing without too much time to implement. But it is about this level that the benefits of the code style escape.
I wholeheartedly approve of all the attempts we make to improve our code base, but it is very common for the rest of the team to be reluctant to react to such important paradigm shifts as this one. Some of the biggest stumbling blocks are currently:
- Unit tests
- Number of class
- Complexity of peer review
The unit tests were incredibly difficult to sell to the team as they all think they are wasting time and are able to test their code much faster as a whole than for each item individually. The use of unit tests as a SOLID endorsement has generally been futile and has become a joke at this point.
The number of classes is probably the biggest obstacle to overcome. Tasks that previously took 5 to 10 files can now take 70 to 100! Although each of these files fulfills a specific purpose, their volume can be overwhelming. The response of the team was mainly moans and headaches. Previously, a task might require one or two repositories, a model or two, a logical layer, and a controller method.
Now, to build a simple file backup application, you have a class to check if the file already exists, a class to write the metadata, a class to extract
Date and hour you can inject time for unit tests, interfaces for each file containing logic, files to hold unit tests for each class, and one or more files to add everything to your DI container.
SOLID is very easy to sell for small to medium sized applications. Everyone sees the benefits and ease of maintenance. However, they simply do not see a good value proposition for SOLID in very large scale applications. I therefore try to find ways to improve the organization and management to enable us to overcome the growth difficulties.