In a project I inherited, on many occasions, there are classes named as XyzDataObject
. Although called DataObject, they mostly look to me like what I usually refer to as a Data Transfer Object (DTO). They have some specialties to them however:
- Used in a an area, where only a subset of the domain data is used (good)
- Consist mainly of standard typed properties (fine)
- Super-minimal logic for instantiation (ok)
- Mapping functions from and to the Domain Objects (oops?)
Now it is my understanding from this answer, that these mapping functions should be separate.
Question:
- Is the mapping feature the reason these objects might be called "Data Objects" instead of Data Transfer Objects?
Or:
- Is this just a naming issue and they should be called DTO's anyway?
- Should the be named something else altoghether because of their mapping capabilities?