Under ADP, is it possible for a module to depend on many services as long as there are no cycles?

Get ready for your Object‑Oriented Programming Test. Use flashcards and multiple-choice questions. Each question includes hints and explanations. Prepare for your exam today!

Multiple Choice

Under ADP, is it possible for a module to depend on many services as long as there are no cycles?

Explanation:
ADP (Acyclic Dependency Principle) means dependencies should form no cycles, not that you’re limited to a single dependency. You can have a module depend on many services as long as the dependency graph is acyclic. In practice, you model modules as nodes and dependencies as directed edges; a cycle would be a path that returns to the starting module. If such a cycle is avoided, the graph can have multiple outgoing edges from a module to several services, and you can still reason about the design with a clear, outer-to-inner ordering. So the best answer is that yes, a module can depend on many services, provided the overall graph remains acyclic. The other options aren’t required by ADP: a single dependency doesn’t inherently create a cycle, and the principle doesn’t mandate read-only services or interface abstraction (though those patterns can help decouple and manage dependencies).

ADP (Acyclic Dependency Principle) means dependencies should form no cycles, not that you’re limited to a single dependency. You can have a module depend on many services as long as the dependency graph is acyclic. In practice, you model modules as nodes and dependencies as directed edges; a cycle would be a path that returns to the starting module. If such a cycle is avoided, the graph can have multiple outgoing edges from a module to several services, and you can still reason about the design with a clear, outer-to-inner ordering.

So the best answer is that yes, a module can depend on many services, provided the overall graph remains acyclic. The other options aren’t required by ADP: a single dependency doesn’t inherently create a cycle, and the principle doesn’t mandate read-only services or interface abstraction (though those patterns can help decouple and manage dependencies).

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy