Bird
0
0

In Clean Architecture, what is the consequence of embedding infrastructure-specific code, like database queries, directly within the Use Cases layer?

medium📝 Conceptual Q6 of 15
LLD - Advanced LLD Concepts
In Clean Architecture, what is the consequence of embedding infrastructure-specific code, like database queries, directly within the Use Cases layer?
AIt creates tight coupling, making business rules dependent on external systems
BIt improves performance by reducing abstraction layers
CIt simplifies testing by consolidating logic in one place
DIt ensures that UI changes automatically propagate to business logic
Step-by-Step Solution
Solution:
  1. Step 1: Identify the role of the Use Cases layer

    The Use Cases layer contains business logic and orchestrates application-specific rules without depending on infrastructure.
  2. Step 2: Understand the impact of embedding infrastructure code

    Embedding database queries or infrastructure code here creates tight coupling between business logic and external systems, violating separation of concerns.
  3. Final Answer:

    It creates tight coupling, making business rules dependent on external systems -> Option A
  4. Quick Check:

    Business logic should remain independent of infrastructure [OK]
Quick Trick: Keep business logic independent of infrastructure code [OK]
Common Mistakes:
  • Assuming embedding database code improves performance
  • Believing it simplifies testing
  • Thinking UI changes affect business logic automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes