Bird
0
0

A system uses Clean Architecture. You want to log all user actions without changing business logic or UI code. Where should you add this logging?

hard📝 Trade-off Q9 of 15
LLD - Advanced LLD Concepts
A system uses Clean Architecture. You want to log all user actions without changing business logic or UI code. Where should you add this logging?
AInside Entities layer
BInside Interface Adapters layer
CInside Frameworks and Drivers layer
DInside Use Cases layer
Step-by-Step Solution
Solution:
  1. Step 1: Identify where cross-cutting concerns like logging fit

    Logging is a technical concern best handled in Interface Adapters to avoid polluting business logic.
  2. Step 2: Confirm other layers' roles

    Entities and Use Cases focus on business rules; Frameworks handle external tools but not direct logging of user actions.
  3. Final Answer:

    Inside Interface Adapters layer -> Option B
  4. Quick Check:

    Logging user actions = Interface Adapters [OK]
Quick Trick: Add logging in Interface Adapters, not Entities [OK]
Common Mistakes:
  • Adding logging inside Entities or Use Cases
  • Placing logging in Frameworks layer
  • Mixing business logic with logging

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes