-
-
Notifications
You must be signed in to change notification settings - Fork 6
Require Dependency Injection #948
Description
For CSLA 6 I am considering requiring that some dependency injection service be enabled/configured in all apps.
Microsoft has included (and used) dependency injection in ASP.NET Core and will continue in .NET 5.
Microsoft has enabled the use of dependency injection for Windows Forms, WPF, console apps, etc. Their templates don't set it up, but it isn't hard to do.
The reason I'm considering requiring it for CSLA 6 is that if I know that I can rely on there being a service provider it becomes much easier (and sometimes just plain possible) to implement some things throughout CSLA.
For example, it would be ideal if you could inject the current logging component into the data portal so you could log events. Today that's possible, but not as easy as in ASP.NET Core, because I don't know for sure that there's a service provider.
There are all sorts of other scenarios where CSLA could do nice/helpful things if only we knew for sure that a service provider was available.
The only negative/breaking impact here, is that any Windows Forms, WPF, console, or other not-ASP.NET style apps would need to add a few lines of code into Program.cs or the startup equivalent file. So I don't think the burden is high, and the potential gains are very high.
Thoughts?