Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello there
I am assigned a project java where the patron DTO is used, but I consulted it that is (dto) disused how evil are data transfer objects or is dto pattern deprecated or not

exist another patron that you will recommend?

I come from Entity Frame-w and c# world where exist repository and unit of work pattern

Note: I have to use JAx RS web service...
Posted
Comments
Sergey Alexandrovich Kryukov 13-Mar-15 10:41am    
At least some posts referenced are pretty bad, some are reasonable...
—SA

1 solution

Please see also: http://en.wikipedia.org/wiki/Data_transfer_object[^].

This article explains the motivation of the pattern and its misuse, which happens when applied in cases unrelated to remote APIs.

—SA
 
Share this answer
 
Comments
GREG_DORIANcod 13-Mar-15 12:27pm    
hmmm... and what pattern do you suggest??
Sergey Alexandrovich Kryukov 13-Mar-15 14:39pm    
I don't know the detail of your requirements. Patterns are not just used or not. They are matched to some architectural development and then used or not, or adopted, or modified, or new patterns are created... It should be driven be the project, not by the pattern. Patterns are just created and shared by the authors of successful products and universally valuable decisions drawn from them, to make development of architectures easier. It's not that a pattern is part of the project's goals.

In your case, if you are using or creating remote APIs, DTO can be useful, or maybe not, but outside of remote APIs, certainly set it aside. Outside of this scope, the whole approach is wrong. Again, using a pattern, any pattern at all, is not one of your goals. Main tool here is your brain. In my view, this is how it looks. After you analyze some goals and/or problems, you start thinking, "shall I apply some regular systematic approach, some pattern, to be implemented on some universal layer of the product?". Then you might start devising such pattern (or not). And only then, you just look around, and ask yourself, "did other people already created something similar?". And only after you do all that, you start considering existing patterns. Or not.

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900