Skip to content

Month: October 2017

Direct Dependencies & Enumeration<T>

In this post, we will be talking about the two types of relationships, namely, direct dependency relationship and enumeration. In terms of a component A and service B, these relationships can be stated as the following: Direct Dependency – A needs B Enumeration – A needs all the kinds of B   Direct Dependency (B) It’s quite common to have a direct dependency relationship –  component A needs service B.…

Being lazy with Lazy<T>

Being lazy doesn’t refer to being lazy in life, but being lazy about the creation or instantiation of objects in our code. Sometimes, creation of an object is very costly. Now, when we say “costly”, we are not talking about money. Rather, we are talking about the memory consumed in the process and by the object itself. Consider a component A that uses a service…