I use jpa and spring.

I have facade where I convert habitually entity to dto. In the service layer, I call method to repository to get entity.

For display, I need to do some operation on data. Is it better to do it directly in the entity or do it in the dto?

  • Usually you have an object that comes from the database, that is then transformed into the main objects (or entities) you use in your application. You do your operations in the second type. – Juan Carlos Eduardo Romaina Ac Oct 20 '18 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.