needle
needle copied to clipboard
Adding plain MVC example (non-reactive)
Hello @rudro @neakor and others,
Firstly, thanks for creating this wonderful DI library that has certainly benefited many many devs and many many companies like ours. We recently started using Needle and we already feel this is so much better than any other DI systems out there primarily due to compile-time safety and for its hierarchical structure. Thank You!
While onboarding, many devs (https://github.com/uber/needle/issues/251) in the community have pointed out that for ease of understanding it would be great to have a non-rx version of the sample included. And therefore, I took a stab at copying the existing implementation and creating a non-rx version of the MVC sample.
I did minimal changes to the design itself since I think it would not make sense to redesign the app given its just a sample and wouldn't be used for anything other than learning the usage of Needle. I just migrated the app to use old-style broadcaster/listener. Hope it all makes sense. Looking forward to hear back :)
Hi @rudro ,
Thanks for taking out time for review and sharing your concerns. Very much appreciated!
While I partially agree to your concerns, there is additional context to it. Let me share some of those here.
- I have been lately working on some internal and external talks on Needle and a significant number of people have shared feedback that understanding a tech becomes harder when samples are built using a specific paradigm, design, library etc (even when they are comfortable with those, I think it just takes away the focus from Needle to learning or understanding something else).
- Similar to us, there are many companies who still don’t use Rx (and some of them go as far as hating it 😅, I promise we are not one of them 😀 ) - and honestly there are genuine reasons for it (some of it me or you may not agree with). This along with #1 could greatly impact adoption of the solid work that the team at Uber has done with Needle.
- Its always better to keep as few dependencies as possible for other reasons such as maintenance cost etc. This is even more true for OSS as the use cases (tech stack) may vary greatly between companies and developers. Rx is just a dependency on the Sample app (not on the library itself) so its not an issue here though.
The broadcaster/listeners I added may look like a super lightweight version of Rx in terms of behavior, but IMHO Rx is completely different paradigm of asynchronous programming which a lot of devs may not be comfortable with YET.
If you think this isn't adding much value, feel free to close the PR.
I tried to reduce friction by removing carthage: https://github.com/uber/needle/pull/383