# Template classes

The template offers convenience operations to create, update, delete, query and provides a mapping between your domain objects and Diana API. The templates classes have the goal to persist an Entity Model through Diana API. It has three components:

* **Converter**: That converts the Entity to a communication level API.
* **EntityManager**: The EntityManager from Diana.
* **Workflow**: That defines the workflow when either save or update an entity These events are useful when you, eg., want to validate data before be saved. See the following picture:

![](https://3316293050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LE6jfzPLlaEm6wKB9kW%2F-LE6jkzgrGEV-uIe_86I%2F-LE6jmp2dU4iHcG6kYuD%2Fintegration-artemis.png?generation=1528064585682538\&alt=media)

The default workflow has four events:

1. **firePreEntity**: The Object received from Artemis.
2. **firePreEntityDataBaseType**: Just like the previous event, however, to a specific database, in other words, each database has a particular event.
3. **firePreAPI**: The object converted to a communication layer.
4. **firePostAPI**: The entity connection as a response from the database.
5. **firePostEntity**: The entity model from the API low level from the `firePostAPI`.
6. **firePostEntityDataBaseType**: Just like the previous event, however, to a specific database, in other words, each database has a particular event.
