|
|
|
|
|
by ducharmdev
1515 days ago
|
|
At work, we have a .Net 6 codebase that had some odd design decisions made in the past couple years. Roughly ~115 classes using Unity for dependency injection instead of ASP.NET Core DI, and this horrible Unity-based service locator pattern used all over the place. Since nothing was using constructor injection and instead just grabbed deps from calls to a global static locator willy-nilly, it was very difficult to tell how many dependencies a given class had. The worst classes were injecting 30-40 dependencies, but you couldn't tell this in looking at them. Anyway - I was tasked with removing Unity and refactoring the service locator usage, since Unity was going to be unsupported soon. Doing this gave me a real sense of agency in our otherwise boring enterprise app; it was one of the rare chances where I could make a significant, wide-scale improvement that would make future development easier for everyone. |
|
(if it were me, i'd be hoping it was one giant monolithic application in one single repo, to make it easier to track & perform this kind of sweeping surgery)