# Application Layer

### Application Service

* Defines the use case for the system
* Receives request from infra layer and coordinate the use of objects from domain layer and other layer

#### Note

* Application service operations can be represented by method (inside object) or function, using function is great if you're not planning to make the service stateful

### Data Transfer Object (DTO)

* Used to transfer data between application layer and infrastructure layer
* Should only contain data
* Should not contain behaviour
* Can be mutable or immutable, make it mutable only if it needs to be modified on transfer


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://note.levelcode.org/software-engineering-notes/readme/5-layers/7-application-layer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
