Could anyone please explain this to me with an example? I am getting contradicted myself
Both seems self contradictory. Can any one explain it with an example? possible in .NET framework.
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.
Really the truly problematic case is when you have both high fan-in and high fan-out:
Where did you read the High Fan Out principle? AFAIK, it is bad with High Fan Out.
http://it.toolbox.com/blogs/enterprise-solutions/design-principles-fanin-vs-fanout-16088
High fan-out in object-oriented design is indicated when an object must deal directly with a large number of other objects. This is indicative of a high degree of class interdependency. In general, the higher the fan-out of an object, the poorer is the overall system design.
Also mentioned in Code Complete, High Fan In with Low Fan Out are good class designs.
Agree with @Jeanno. High Fan-Out is undesirable.
"The fanout of a module is the number of calls from that module. At least three studies have concluded that fanout squared is one component of a design metric that correlates well to probability of defect." Grady, R.B., "Successfully applying software metrics," in Computer , vol.27, no.9, pp.18-25, Sept. 1994 doi: 10.1109/2.312034
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With