What problem does it solve?
This Skill addresses the "Tell, Don't Ask" (TDA) principle in object-oriented programming, preventing anemic domain models and promoting encapsulated behavior.
Core Features & Use Cases
- Encapsulates Logic: Moves decision-making and state manipulation logic inside the objects themselves, rather than exposing internal state for external code to act upon.
- Improves Readability: Leads to cleaner, more intuitive client code that issues commands rather than querying state and orchestrating complex logic.
- Use Case: Instead of an external function checking an order's status and then updating it, the
Order object itself has a confirm() method that handles all internal state transitions and validations.
Quick Start
Use the tda skill to refactor the provided Python code snippet to follow the Tell, Don't Ask principle.