# Intent.Modelers.Domain.Services

A **Domain Service** holds domain logic that does not naturally belong to any single entity — a calculation that spans several aggregates, a policy that needs to be applied consistently, an operation whose inputs come from more than one place. Putting it in a Domain Service keeps it inside the domain layer rather than leaking into application or infrastructure code.

The `Intent.Modelers.Domain.Services` module adds the `Domain Service` element to **Intent Architect**'s Domain designer. It is designer metadata only; the code is generated by the modules that consume these elements.

## Modeling a Domain Service

In the **Domain Designer**, right-click a Package or Folder and select **`New Domain Service`**. Then right-click the service and select **`Add Operation`** for each piece of behaviour it exposes.

Each operation can declare parameters and a return type, like any other modelled operation. Where a complex object needs to be passed in or returned, use a Data Contract or a Value Object rather than a long parameter list.

Domain Service operations carry the `[Invokable]` trait, so they can be invoked from the places that orchestrate domain behaviour.

## Diagram styling

A Domain Service is drawn on Domain diagrams as a green card matching the rest of the designer, with its operations listed as rows. The styling system itself is documented in `Intent.Modelers.Domain`'s `CONTEXT.md`.
