I have an SOA app, and have started to run into some performance issues.
I have models coming OUT of REST that look similar to...
public class Person
{
public Guid Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public Address Address { get; set; }
public IEnumerable<Hobby> Hobbies { get; set; }
public IEnumerable<Interests> Interests { get; set; }
public IEnumerable<Friends> Friends { get; set; }
}
This turns into a pretty large model pretty quickly when it is being returned via REST with all of those fields populated.
So, my basic question is...Is it better to transfer large models such as above, and use FEWER Rest calls, or transfer smaller objects and use more Rest calls to retrieve the other pieces of data. I.E. have a model like this...
public class Person
{
public Guid Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public AddressId AddressId { get; set; }
public IEnumerable<Guid> Hobbies { get; set; }
public IEnumerable<Guid> Interests { get; set; }
public IEnumerable<Guid> Friends { get; set; }
}
And now go an grab the other properties as needed...
Thoughts?