Search code examples
c#.netdesign-patterns

Design Principle High Fan in vs High Fan out


Could anyone please explain this to me with an example? I am getting contradicted myself

  • High Fan in: A given class designed in such a way that a high number of other classes can easily consume it.
  • High Fan out: A class should be using lot of other classes.

Both seem mutually contradictory. Can anyone explain it with an example using .NET framework if possible?


Solution

  • High Fan In is good rule for low level classes. They should be highly reusable by higher level classes. High Fan Out is good rule for high level classes. They should not "reinvent the wheel", but use the already existing code - found in low level classes.

    So the rules are not contradicting because they relate to different classes.