> > I read in many sites that is better create another object to pass to > another layers in place of the domain objects, but what is the advantage of > this way to justify the extra work? I'm working in a dynamic language in the > UI, I don't have strongly typed objects and my UI knows whats is loading in > each view. Why i have to create for example 5 Book DTO different depending > in the context that the UI layer is demanding, one book for show the > product, another for the view of invoices.... >
This is usually what you do! You have a view model and your domain model which you map somewhere. Having such a mapping makes maintenance and testing a very nice thing to do! I really would not like to take your application in maintenance if you just map your data from storage to user interface and back. If that is what you want, then why not have direct database connections from your client like in the client/server days. -- Ramon
