I've been assigned to work on a site that uses MVC for the presentation layer and that talks to a WCF service. The two use DTO's to pass information back and forth.
Currently, DTO's are used throughout the MVC portion (User, Address, Account Information). For example, the User class in MVC has a PersonDTO that contains all the information about the user as well as methods specific to the web (Login):
public class User
{
public PersonDTO Person { get; set; }
public void Login { /* Login */ }
}
So to get the users first name, you would do:
var CurrentUser = new User();
var firstName = CurrentUser.Person.First;
Is there a better way of doing this? (It seems like it should be CurrentUser.First)
Other than being wordy, are there any pitfalls of doing this?
Are DTO's meant to bleed into Controller Actions in MVC?