> For the complete documentation index, see [llms.txt](https://mirkorap16.gitbook.io/clean-architecture/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mirkorap16.gitbook.io/clean-architecture/delimitazioni-tracciare-una-linea.md).

# Delimitazioni: tracciare una linea

L'architettura del software consiste nel tracciare delle linee, che chiamiamo **delimitazioni**, per separare i componenti l'uno dall'altro. Alcune di queste linee possono essere tracciate molto più tardi, poiché riguardano decisioni secondarie e differibili. Tra queste troviamo: il framework, il database, il server web e via discorrendo.

### Quali linee tracciare e quando tracciarle?

Occorre tracciare delle linee tra le cose che contano e quelle che non contano. Alle regole operative non interessa il database, pertanto ci dovrebbe essere una linea di separazione. Alle regole operative interessa soltanto sapere che esistono delle funzioni, nascoste dietro interfaccia, che servono per leggere e salvare i dati. Poi se viene usato un database relazionale, oppure non relazionale o ancora dei semplici file, alle regole operative questo non gli deve interessare.

![](/files/-M-BbBKLP5s5dJoOTCh9)

Le *BusinessRules* usano l'interfaccia *DatabaseInterface* per leggere e salvare i dati. La classe *DatabaseAccess* implementa l'interfaccia *DatabaseInterface* per leggere e scrivere i dati su un database. Le *BusinessRules* sono completamente all'oscuro di come e dove vengono salvati i dati. Questo ci consente di definire la seguente **delimitazione** tra i due componenti:

![](/files/-M-BcAqPj_GNa0ScKAR4)

Ciò ci permette di posticipare la decisione su quale tipo di database utilizzare e concentrarci maggiormente sulle regole operative.

### Architettura a plugin

Tutte queste decisioni differibili come il database, l'interfaccia utente (GUI), il framework e così via, ci consentono di avere un sistema scalabile e manutenibile. Dove le regole operative vengono mantenute separate e indipendenti dai componenti opzionali. Questa architettura viene definita **architettura a plugin**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://mirkorap16.gitbook.io/clean-architecture/delimitazioni-tracciare-una-linea.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
