-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Registration by convention #42
Comments
I think it's a great idea. Which conventions do you think would be the most useful? |
So the ones I find myself using the most are
So for example with Scrutor the convention registration ends up looking like this. In this particular case we are looking for all implementations of the interface
With Ninject the API surface for registering by convention adds a layer of abstraction over the type discovery and filtering. This abstraction while nice for the end developer I think is overkill. The simpler API of Scrutor I feel is more familiar to developers and does not require them to learn another API. Ninject adds more conventions but these are the ones I find myself using the most :
The other thing to consider when registering types by convention is what lifetime is going to be applied to each registration. I have registered types by convention with all lifetimes but Singleton and Transient lifetimes are the most common lifetime used with Convention based registration in my experience |
I know at this point you are working through core features, stability and things of that nature. One thought / question that came up when looking at this project is will it be possible to support some kind of convention based registration ? With a traditional IoC container convention based registration comes with a time cost. scanning assemblies for types and doing type checks is expensive. This means application start takes longer. A compile time IoC can solve this issue if it supported such a feature.
Again. I know this is an advanced feature and there are other priorities at this point but wanted to plant the seed of what I think would be a game changing feature.
The text was updated successfully, but these errors were encountered: