Recall & Review
beginner
What is a Use Case (Interactor) in Android app architecture?
A Use Case, also called an Interactor, is a class that contains the business logic of the app. It handles a specific task or action, like fetching data or processing user input, separate from UI or data layers.Click to reveal answer
beginner
Why should Use Cases be separate from UI and data layers?
Separating Use Cases keeps business logic independent. This makes the app easier to test, maintain, and change without affecting UI or data code.
Click to reveal answer
intermediate
In Kotlin, how might a simple Use Case class look?A Use Case class usually has a single public function, like `execute()`, that performs the task. It can use repositories to get or save data.Click to reveal answer
intermediate
What role do repositories play in Use Cases?
Repositories provide data to Use Cases. Use Cases ask repositories for data or tell them to save data, keeping data access details hidden from the business logic.
Click to reveal answer
intermediate
How do Use Cases improve app testing?
Because Use Cases contain business logic separate from UI and data, you can test them easily by giving fake data sources and checking the results without running the full app.
Click to reveal answer
What is the main responsibility of a Use Case (Interactor)?
✗ Incorrect
Use Cases focus on business logic, not UI or data storage.
Why do we separate Use Cases from UI code?
✗ Incorrect
Separating Use Cases keeps business logic independent and easier to test.
Which layer typically provides data to Use Cases?
✗ Incorrect
Repositories provide data to Use Cases, hiding data source details.
What is a common function name in a Use Case class?
✗ Incorrect
Use Cases often have an execute() function to run their task.
How do Use Cases help with app testing?
✗ Incorrect
Use Cases separate business logic so it can be tested without UI or data dependencies.
Explain what a Use Case (Interactor) is and why it is important in Android app architecture.
Think about how your app handles tasks behind the scenes, separate from what the user sees.
You got /4 concepts.
Describe how Use Cases interact with repositories and why this separation matters.
Imagine a waiter (Use Case) asking the kitchen (repository) for food without knowing how the kitchen works.
You got /4 concepts.