samedi 12 juin 2021

If i am converting a entity to a DTO where this conversion code should exist?

If i am converting a entity to a DTO where this conversion methord should exist?

  1. in a utility class
  2. in same entity
  3. in DTO

I usually put these in utility class, but thinking why should not i move this to entity or DTO.

Like object (here: DTO or entity) should know what and how operation can be done on it (here: conversion)

Aucun commentaire:

Enregistrer un commentaire