DMOs
The DMOs are the well known Data Mapper Object and into the Torpedo ecosystem DMOs are the chosen objects to use as output.
Each defined output adapter will have their own DMO instance. Sometimes could be the same one or sometimes not.
A DMO instance has the responsibility to map the entity data to the specific adapter. For instance, an adapter of type
mongodb
will have a DMO with the capability to encode (map) the entity data to bson
format.
Let's illustrate this with the Author's Blog Entity sample.
Having the previous defined author entity schema as:
And the output adapter as mongodb
the generated DMO will be an object with the capability to be stored in MongoDB
implementing the generated interface.
Following the golang implementation, the generated DMO will be: