79520573

Date: 2025-03-19 15:02:56
Score: 1
Natty:
Report link

Your approach (directly modifying the entity within a transaction) is more efficient, simpler, and cleaner. On the other hand, your colleague’s approach is redundant in most cases, though useful when enforcing strict separation between data layers or when using immutable DTOs for business logic transformations. Why?

1. Entity Lifecycle & Persistence Context

2. Lazy vs. Eager Fetching

3. When DTOs Make Sense

However, for modifying and persisting entities, DTOs should not be mandatory unless:

4. Performance Expectations

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Blacklisted phrase (0.5): Why?
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Carl Sony