Explore >> Select a destination


You are here

brandonsavage.net
| | conductofcode.io
5.1 parsecs away

Travel
| | I had reason to revisit the automocked base class from a previous blog post. I am working with another code base and have new opportunities for automocking. We have a lot of internal classes. Approximately 30% of the classes are marked as internal. The old approach did not work anymore.
| | solnic.dev
5.0 parsecs away

Travel
| | I was wondering what do we, rubyists, think about dependency injection these days as I remember some discussions about it which were mostly lots of post-java-trauma type of criticism. I had this blog post in the back of my head for a long time but knowing that this subject was sort of...explored...
| | sookocheff.com
2.6 parsecs away

Travel
| | Inversion of Control (IoC), also known as Dependency Injection (DI), allows an object to define their dependencies as constructor arguments (strictly speaking, you can set these dependencies as properties, but the examples I will use today are constructor-based). This is the inverse of the object itself controlling the instantiation or location of its dependencies, hence the name Inversion of Control. Let's look at an example from Stackoverflow using a text editor with a spell checking component:
| | benoitpasquier.com
34.9 parsecs away

Travel
| To be sure new code won't break old one already implemented, it's best practice to write unit tests. When it comes to app architectures, it can be a challenge to write those tests. Following an MVVM pattern, how to unit test a view and its viewModel? That's what I would like to cover here using dependency injection.