Appearance
Services Management
These rules define service ownership and composition for frontend applications regardless of framework. Vue code may appear in examples; it illustrates the decision rather than limiting its scope.
Status
Accepted
Rules
| Rule | Scope |
|---|---|
| Create services around meaningful responsibilities | Service creation, ownership, and avoiding premature abstractions |
| Keep services independent from UI concerns | State, lifecycle, and presentation separation |
| Use services for API contracts and workflows | Framework-neutral client/API coordination principles |
| Compose services around business domains | Framework-neutral service composition and ownership |
| Separate services, business components, and stores | Choosing the correct owner for reusable logic and state |
| Keep services independently testable | Testability and maintenance rules |
Core Principle
A service is the boundary for reusable business or application logic that exists independently from the UI. It may coordinate the frontend with an API, transform data, and implement client-owned workflows, while remaining independent from framework reactivity and component lifecycle.
These rules complement the component management rules, the state ownership rules, and the frontend application structure.