To connect to postgres I am using exposed and to d...
# exposed
u
To connect to postgres I am using exposed and to do so I had to define a Table object which basically is exactly the same as my postgres table. Now I also have a data class which represents my entries from that database. Now I feel like this is a bit redundant and I am defining the same coumns twice, once as Table for exposed and once as data class for my logic. Is there a best practice or "clean code" way to do this?
p
I think it is always a good way of separation between the data format, that is stored in the database, and the internal domain model, that represents your business case. The mapping layer between these two parts is the necessary part for separation. It's also a good way to keep the persistence framework out of the domain.
👍🏾 1
👍 5
u
Fair point...