In recent years, we have been slowly changing to a progressively better written code, a few baby steps at a time. Finally we are beginning to change to something that at least looks like SOLID, but we have not reached that point yet. Since making the change, one of the biggest complaints from developers is that they can not support peer review and the movement of dozens and dozens of files in which previously each task only required the developer to play 5-10 files.
Before beginning to make the change, our architecture was organized in a very similar way to the following (granted, with one or two orders of magnitude more files):
- Entities (database entities)
- Models (Domain Models)
As for the file, everything was incredibly linear and compact. Obviously, there was a lot of duplication of code, tight coupling and headaches, however, everyone could go through and solve it. The complete beginners, the people who had never opened Visual Studio, could solve it in a few weeks. The lack of file complexity in general makes it relatively easy for novice developers and new hires to start contributing without too much acceleration time. But here is practically where the benefits of the code style come out the window.
I wholeheartedly support all the attempts we make to improve our code base, but it is very common for the rest of the team to reject a massive paradigm shift like this. A couple of the most important points at present are:
- Unit tests
- Class counting
- Complexity of peer review
The unit tests have been incredibly difficult to sell to the team, as they all believe that they are a waste of time and that they can handle and test their code much more quickly than each piece individually. The use of unit tests as backup for SOLID has been mostly useless and has become a joke at this point.
Class counting is probably the biggest obstacle to overcome. Tasks that used to take files 5-10 can now take 70-100! While each of these files has a different purpose, the large volume of files can be overwhelming. The team's response has been mainly moaning and scratching their heads. Previously, a task may have required one or two repositories, a model or two, a logical layer, and a controller method.
Now, to create a simple application to save files, you have a class to verify if the file already exists, a class to write the metadata, a class to abstract.
DateTime.Now so you can inject time for unit tests, interfaces for each file that contains logic, files to contain unit tests for each class, and one or more files to add everything to your DI container.
For small to medium-sized applications, SOLID is a very easy sale. Everyone sees the benefit and ease of maintenance. However, they simply do not see a good value proposition for SOLID in large-scale applications. So I'm trying to find ways to improve the organization and management to overcome the growth problems.