# Data Persistence: DAO Pattern.

The DAO persistence pattern serves to isolate the persistence layer of the application layer, thus allowing both parts to evolve separately without knowing anything about the other.

### Structures

{% code title="Structures" %}

```
└── src
    └── main
        └── java
            └── com.your_company_name.your_name_app
                .
                .
                .
                └── persistence
                    └──SampleDAO.java
```

{% endcode %}

You can see an example using DAO in TotalCross in the [SQLite documentation](https://app.gitbook.com/@totalcross/s/playbook/~/drafts/-Ld5U4zrEcGVLc5JZxHO/primary/learn-totalcross/how-to-store-data-sqlite#inserting-data-into-the-table)

## Referencies

* See more about DAO Pattern in [baeldung ](< https://www.baeldung.com/java-dao-pattern>)and [DevMedia](https://www.devmedia.com.br/dao-pattern-persistencia-de-dados-utilizando-o-padrao-dao/30999)


---

# 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://learn.totalcross.com/documentation/guides/app-architecture/suggested-design-patterns/dao.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.
