-
Notifications
You must be signed in to change notification settings - Fork 458
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
Change WindsorServiceProviderFactory to follow SOLID behaviour #540
Change WindsorServiceProviderFactory to follow SOLID behaviour #540
Conversation
…viderFactoryBase to improve SOLID behaviour and allow more external control castleproject#536
@ltines @jonorossi please consider this change. I have made the IServiceProviderFactory follow more a SOLID approach and contained relevant logic fo the IServiceProviderFactory in a baes class. I think this change is very important for the openness of the package. I had the same discussion with Gary when making aspnetcore2.x. It was also closed initially but was opened by demand later. Maybe this time best to allow substitution from the start? |
@jonorossi @ltines After converting one of my largest apsnetcore apps. That uses a multitude of special features from aspnectore. I have added extra methods in HostBuilderExtensions to allow the openness needed to control the container and factory. Missing tests. Waiting for dialogue about changes. However without this for of an update, i cannot see that the castle implementation will allow migration to 3.x of larger aspnetcore applications. |
…factory with extenal container passes castleproject#535
@ltines any thoughts on this PR. |
@jonorossi @ltines I know the current implementation will give many issues, as we need access to the container before the service collections are made. Some service collections additions use options that require usage of class implementations (eg modelbinder) Thoughts please? Thought please, I know I will not be able to use the full DI without this change (so far I have forked and created own package) |
@generik0 I'm happy to facilitate changes to Windsor that the community wants, however I don't have time to be involved in the specific direction of this extension project, I won't be commenting on the specific changes. If @ltines is no longer interested or doesn't have time to be involved with this extension library, then I recommend getting at least one other person involved, there appeared to be interest from many users in the issue. |
At my company we are at a crossroads now with Castle Windsor and Asp.Net Core. Due to how the two libraries are no longer working well together, we have to either support CastleWindsor or migrate our IoC to MS. |
Hi @AntonioDrusin it does support aspnetcore 2.x and now 3.x Everything is working. NodeService, Authentication, SignalR, swagger, rest api, it all! The package is in beta because we still need people like you and you company to try the beta package... If you need any help, just let me know ;-) PS, with these changes I have made, the container is usable before the service collections are built. Meaning more versatility than any other DI that can only be "conforming" |
@generik0 ok, let me pull this branch and give it a test. One of my main issues was the lifetime of transient services. I'll see what it looks like in this branch. Thank you. |
@AntonioDrusin the prerelease is also on nuget.org, so you can install the current beta from there. However, this does not give access to the container in the servicecollection registration in startup. What is your worry about the transient? For me it works as standard... |
I filed #530 about that. In a simple proof of concept it does not look like transient dependencies of controllers get released when the controller gets released. |
Very interesting @AntonioDrusin i did not catch this before |
I agree with your changes @generik0. There are a lot of important choices made in the WindsorServiceProviderFactoryBase class. I feel it is important to allow clients of this library to adjust subresolver behavior and the scope behaviors that are determined by that class. |
With this change we probably want to update docs/net-dependency-extension.md to cover the way the new configuration is open to change. |
I am happy to volunteer to provide an update to the md file if you want. |
@jonorossi I am looking at this extension to use within my company's microservices. While I can probably use the vanilla version of this extension it would be preferable to have the more extensible version that this PR provides. Are there any steps we should follow to get this PR merged? Thank you. |
@AntonioDrusin please Update .md If you have time. |
@jonorossi please note. I have tested the facility on a rather large web solution with aspnetcore 3.1 + angular (newest). I need to open the facility up like this to get it to work. If @AntonioDrusin (or I) improve the readme, can we please get it into master. We need this change! :-/ |
@AntonioDrusin no idea really. As I commented earlier in this thread I'm happy to do a final code review and get the changes released, however don't have time for the back and forth to work out what it should actually do and fit into the Microsoft Extensions project. Since there appeared to be some disagreement on how this facility should work I asked in that comment above for one other person who is actually planning to use this be involved to review these changes and then we can move forward. If it isn't clear, what I'm asking for is for people who actually want to use this stuff to actually review it and see if it works with their project, I'm no one special, don't underestimate your ability to contribute, nothing is perfect but without contributions (in the form of code, code reviews, bug reports, documentation, etc) things don't move forward. Everyone should have GitHub permissions to comment on the code, I just want to see a seconder that is happy with the changes. |
@generik0 there is still a broken unit test with these changes:
|
@jonorossi i found the issue. I had added an extra set off UTests. Using the DependencyInjectionSpecificationTests. Unfortunately looks like the static "stuff" in implementation (original) does not allow for 2 tests. something must be common for the test assembly. Beyond my control. Not an issue with code. Prob issue with MS Tests |
6b7980a
to
b536e58
Compare
@jonorossi apart from doco Update, is there anything missing before we can completed this merge? Please note. I have NOT changed any of the original logic. Just refactored away from using extensions, and adding opened up to allow users to use there own controller or get the container created by the facility. |
@generik0 sorry for being so slack responding to this, a bit going on this end. Looks great, I assume you'll submit another pull request for documentation and changelog updates. |
#535