I have a question which is more design pattern rel...
# announcements
k
I have a question which is more design pattern related than Kotlin related (I'm not sure where to even ask this). Say you have an API endpoint
POST /endpoint
which requires posted json data to be of a specific json structure. You then mutate this data into something that goes into your database. Where does this mutation take place? On your repository, or something before that and after the endpoint handler?
stackoverflow 4
t
Briefly check 3 layered architecture, it should clarify exactly where specific transformations should take place. Generally speaking. DTO to Business Object transformation takes place in your DT (Data transfer) layer. And the transformation from your business model to your data access model takes place in your data access layer. Keeps the three layers nice and clean.
k
Thanks man