We are starting a new web application and we decided to use N-Tier design.
We have some disagreement about the objects that transfer data between layers (DTO),
should there be methods in them?
If it’s to organize the data from 2 databases, should we create one DTO for all layer per object? What is the standard?
We are reading the web application design by Microsoft.
DTO object is usaually a container for data and has no behavior. There are many ways of implementing the mapping between tiers using the DTO objects.
You could have some guidelines reading the article about DTO from MS pattern & practice team : http://msdn.microsoft.com/en-us/library/ff649585.aspx
There is another ressource on SO : How to effectively use DTO objects (Data Transfer Objects)?
You could also have a look on a working project sample “Microsoft – Domain Oriented N-Layered .NET 4.0 App Sample ” : http://microsoftnlayerapp.codeplex.com/ where many patterns are used and the DTO also.