114k views
5 votes
What is the Explicit Dependencies Principle? Explain why explicit dependencies are better than implicit dependencies.

User Mpmp
by
4.9k points

1 Answer

6 votes

Answer:

Step-by-step explanation:

Explicit Dependencies

It states that the classes and methods should explicitly require , via constructor or method parameters all the collaborating objects that are required for the function to work properly .

Classes with the implicit dependencies cost very high for the maintenance than the explicit dependencies .

Even , the implicit dependencies are difficult to test as they are tightly coupled to their collaborators .

User Lance Kidwell
by
5.6k points