jonsamwell / flutter_simple_dependency_injection

A super simple dependency injection implementation for flutter that behaviours like any normal IOC container and does not rely on mirrors
MIT License
94 stars 8 forks source link

Feature Request and Thank You! #6

Closed HerrNiklasRaab closed 5 years ago

HerrNiklasRaab commented 5 years ago

Hello,

thank you for your work you have done already!

Two questions:

Thanks for your time,

Niklas

jonsamwell commented 5 years ago

Hi @HerrNiklasRaab

Yes I am actively maintaining this and using it in a couple of apps in production (ios and android).

The @Injectable is a tricky one as this is a runtime dependency injector rather than a compile time one. Keep in mind that we cannot use mirrors (reflection) in flutter as it is not included so the annotation route is a compile time one.

I favour the approach of simple code rather than relying on build time code generation.

In that essence I modularize the dependency injection creating a container that invokes smaller module containers to manage the dependencies of that part of the app. This helps manage a large number of dependencies.

HerrNiklasRaab commented 5 years ago

Ok, great the we will also use this in production. With @Injectible I thought so because i saw this package: https://github.com/ltackmann/dice. But your Api is "more friendly", this is why i chose yours.

Just tried to use your package, works like charme :)

jonsamwell commented 5 years ago

Awesome, thanks for using it. Let me know if you need a new feature or anything.

Jon

On Fri, 12 Oct 2018, 21:03 HerrNiklasRaab, notifications@github.com wrote:

Ok, great the we will also use this in production. With @Injectible I thought so because i saw this package: https://github.com/ltackmann/dice. But your Api is "more friendly", this is why i chose yours.

Just tried to use your package, works like charme :)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/jonsamwell/flutter_simple_dependency_injection/issues/6#issuecomment-429274421, or mute the thread https://github.com/notifications/unsubscribe-auth/ADhfoYsBQPJT1tRxzLgf8GGbUMZMioW1ks5ukGkMgaJpZM4XZEY0 .

HerrNiklasRaab commented 5 years ago

Did you checked out the dice project how they handle the @Injectable?

jonsamwell commented 5 years ago

Hi @HerrNiklasRaab dice uses mirrors (reflection) to handle the @Injectable annotation so I won't be able to use this in Flutter as it does not come with mirrors.

HerrNiklasRaab commented 5 years ago

Ok, no problem, still great software!

jonsamwell commented 5 years ago

Thanks!