ASP.NET controllers
Being explicit with registering artifacts of your application is very common among different frameworks. Discovering the artifacts and just doing an automated self-registration of them is becoming more popular. But it’s very common that you will have to go and explicitly add everything manually.
Although it is very clear what is going on with these registrations, the downside of manual registration is that you are basically adding code that is not directly contributing to the business value you’re trying to achieve. It is also code that is highly repeatable and tends to end up in large files with all the initialization going on.
For instance, with ASP.NET Core 6 we got a brand-new minimal API, which is designed to have a smaller footprint and less ceremony to get started. You can start creating a Web API with three lines of setup code and then add your API as HTTP methods with routes at will.
This is all fine and dandy, but can quite easily...