> For the complete documentation index, see [llms.txt](https://dev7days.gitbook.io/dev7days/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev7days.gitbook.io/dev7days/fundamental/dto-vs-dao.md).

# DTO vs DAO

Describe about DTO and DAO

A DTO or Data Transfer Object is an object used for data sent between classes and modules within an application. Use DAOs or Data Access Objects for encapsulating logic that manages data sources.

**Example**

```java
interface PersonDTO {
    String getName();
    void setName(String name);
    //.....
}

interface PersonDAO {
    PersonDTO findById(long id);
    void save(PersonDTO person);
    //.....
}
```
