Tuesday, 13 October 2015

Data transfer in application

Lately it returns one topic in my mind. How to implement data flow between layers in my application.
My last habit was to convert entity to immutable dto (service layer) and then when I'd like to update object I converted another time dto (at controller layer) to bean. In this case I have 2 mapping. When I need to add some attribute I have to change 3 objects.
I always assume that entity can't go out from service, so my new idea to improve this solution.
Now I try one of case:
  1. use class with excluding interface . 
  2. create builder as now with getters. 

Other idea is to use mutable beans when I plan to update object or immutable in other case.

No comments:

Post a Comment