Convert between data and transfer objects