Connascence of Identity
We have Connascence of Identity (CoI) when one or more components must reference exactly one particular instance of another entity to work correctly.
This is the strongest form of connascence in code and it is usually not easy to spot. The code apparently looks fine, but gives errors under certain conditions. The dependency in this case is within the creational context of a particular entity. Given the distributed nature of modern systems, it is almost never a good idea to rely on a particular instance of any object.
Let's see a simple example (and let's forget about thread safety):
public class GlobalCounter{ int count = 0; public void Increment(){ count++; } public int CurrentCount(){ return count; } } public class Controller...