z4kn4fein / stashbox

A lightweight, fast, and portable dependency injection framework for .NET-based solutions.
https://z4kn4fein.github.io/stashbox
MIT License
140 stars 10 forks source link

[Not a Bug] Noob Question - Can anyone explain why I would use this over the standard Microsoft.DependencyInjection Library #109

Closed jeffward01 closed 2 years ago

jeffward01 commented 2 years ago

Hello all!

Sorry for asking a simple question like this, but I could not find another place to ask this.

I understand that in itself the Microsoft 'standard' dependency injection library is somewhat of an anti-pattern and also limited in features compared to Autofac for example.

I looked at the code and examples for Stashbox, it looks VERY CLEAN!! I would love to use it, but I would love to know a reason of why I should use it specifically.

For example, if I need event interception of calling methods, or some other fancy things I can use AutoFac.

What does Stashbox bring to the playing field that makes it stand apart from the rest (aside from a super clean and nice Fluent Interface pattern <3)

Thanks!

@z4kn4fein

vnvizitiu commented 2 years ago

Hello,

I know this was meant for @z4kn4fein but if I can chime in for my own use cases.

Here are a few reasons that pulled me towards it:

All of these features I'm currently using in my projects.

Hope this is helpful.

Cheers,

z4kn4fein commented 2 years ago

Hey,

@vnvizitiu Thank you for sharing your points, it's really good to see how you are using Stashbox, and which features exactly!

@jeffward01 Thank you for reaching out, I'm happy you like Stashbox! Unfortunately, I can't give you a straight answer for why you should use Stashbox over any other containers, because I think the answer depends on your needs and preferences the most. One of these preferences could be the need for a fluent API that you already mentioned Stashbox has, but there are also more aspects you have to examine first to make the final decision.

It could be a really hard choice because there are a bunch of Dependency Injection container implementations out there that have similar functionalities with different or just slightly different APIs and approaches to solve specific tasks. Also, most of them have a lot of features, that you might even don't know yet whether you want to use ever, or not. This could be overwhelming and also could move the reasons behind the choice to a more emotional level. Like which one feels the most natural to use? Or which gives the handiest options to fulfill your requirements?

I think it would be kinda pointless to highlight here the list of features that Stashbox has because you probably already saw them in the docs. Also, I would like to be completely honest here (because I don't like direct marketing 😄), I don't think Stashbox has more or better features than Autofac, despite I'm not super familiar with it. Stashbox has a similar feature set, a similar set of extensions, but a different API and better performance based on these metrics.

So my key points are that it has a decent amount of features, configuration capabilities, and extensions along with a good performance. Also, I'm always trying to do my best in terms of support, feature requests, and following up on the new technologies as fast as I can where Stashbox has or can have a good fit.

Please let me know your thoughts, and if you have questions feel free to ask!

Thanks!

Edit: I have removed the usage examples I mentioned previously as they were kind of edge cases and didn't give much to the general context.

z4kn4fein commented 2 years ago

One more thing, I'd be grateful if you could let me know which library you ended up with and why. If it's happen to be Stashbox, I'd be happy to hear your feedback on it, so I can use your aspects to improve the project. Thanks in advance!

github-actions[bot] commented 2 years ago

This issue is marked as stale because it has been open 30 days with no activity.

github-actions[bot] commented 2 years ago

This issue was closed due to no activity.