# Managers For Complex Orchestration

> Managers For Complex Orchestration in the Mobile Action Pro course.

- URL: https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/06-clean-architecture/lesson-07-manager-pattern
- Course: [Mobile Action Pro](https://dantech.academy/en/courses/kotlin-accelerator.md)
- Module: Clean Architecture in Depth
- Duration: 25 min
- Difficulty: intermediate
- Access: Enrolled students
- Tiếng Việt: https://dantech.academy/courses/kotlin-accelerator/engineer-builder/06-clean-architecture/lesson-07-manager-pattern.md

## Objectives

- Tell managers (stateful, single) apart from use cases (stateless, factory)
- Read how SubscriptionManagerImpl exposes StateFlow and uses the singleton scope
- Find and fix a check-then-set race with MutableStateFlow's getAndUpdate

## In this lesson

1. Lesson Goal
2. Part 1: What A Manager Is In This Repo
3. Part 2: A Manager Wraps State In A StateFlow
4. Part 3: A Manager Holds A Complex Rule
5. Part 4: Feature-Specific Helpers
6. Practice Exercise
7. Code Reading Path
8. Signs To Avoid
9. References
10. Key Points

## Study with an AI agent

The full lesson is for students of this course. Students open the lesson on the web and press **Markdown** to copy all of it, then paste it into Claude, ChatGPT, Cursor or whichever agent you use. Faster: mint a token at `/profile/ai-agents` and your agent reads lessons over MCP.

- [Join the course](https://dantech.academy/en/kotlin-accelerator/checkout)

---

- Previous lesson: [UseCase Pattern](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/06-clean-architecture/lesson-06-usecase-pattern.md)
- Next lesson: [Data Flow Patterns](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/06-clean-architecture/lesson-08-data-flow-patterns.md)
