#1 2021-05-03 11:20:24

sakura
Member
From: Germany
Registered: 2018-02-21
Posts: 218
Website

mORMot2 - mapping between ORM and KDD/DDD classes

Hi,

as DDD has not yet been made available to mORMot2, ist there a preferred way to get DDD-classes (based upon TSynAutoCreateFields) filled with data retrieved into TOrm classes?

Regards,
Daniel

Offline

#2 2021-05-04 05:25:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: mORMot2 - mapping between ORM and KDD/DDD classes

Manual conversion from DDD aggregate to TOrm class is a simple possibility.
Perhaps a bit verbose at first, but if you have one-to-one mapping of the field names you could simply use a temporary JSON conversion.

You could put the conversion methods into the TOrm class definition. In DDD it is OK to have the persistence layer having a dependency with the domain objects.
But don't put the conversion methods into the DDD class: it should stay uncoupled.

Offline

Board footer

Powered by FluxBB