I'm not a guru but... Once I thought that DTOs are a nice way to separate the webapp's layers, just because they are simply data containers and have no logic. But now I think they are completely useless, because they have no logic! I know it is stupid to use the same answer for two opposite points of view. The cause of my change-of-mind is the so-called "anhemic programming" that DTOs promote. I think it is best to use directly domain objects, i.e. ye old (but good) OOP with "real" objects. Someone could say that this breaks security, but I don't think so, because security will be broken only with a misuse of these objects (e.g. calling business methods in JSPs). I am sure that many developers of the list agree with me, and many others don't. I think that the "ease of code" principle must be followed, then DTOs are simply a loss of time, IMO. Ciao Antonio Petrelli
[EMAIL PROTECTED] wrote: >Hi, Gurus, > >Background: I just started a Struts project with Hibernate. I have chosen to use the Data Access Object with (Abstract Factory) design pattern because my client uses Oracle and I use Postgresql database. I am working with other teams remotely and they decided to use DTO. > >Problem: A few months ago, I recall a message thread on this list with a subject header of: 'DTOs are evil'. Since I am new to this, I am having problems understanding why. I thought that DTO are for data storage and data transfer between Business and Value Objects. > >Questions: I have the following questions: > >1. Why I shouldn't choose it? > >2. Should I be using the Apache Commons BeanUtils in my action? It has a method like BeanUtils.copyProperties(...). > >3. If not BeanUtils, then what do you recommend? > > >Thanks, > >Bob > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around >http://mail.yahoo.com > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]