Integration services
-
We have to create some integration web services and were thinking about best practices. Should we favor flattening out the object model or be verbose (leave less room for interpretation/error)? Example 1. Complex Types – The employeeListItem would be used to provide summary information about the employees. The salaryEmployee and hourlyEmployee would be used to provide details. (‘Salary’ or ‘Hourly’) Example 2. Flatten objects – Just one type here all the details are provided in one object. When an employee is of type ‘Salary’ the ‘hourlyRate’ and ‘hoursPerWeek’ will be unused. (‘Salary’ or ‘Hourly’) Of course our objects are not as simple as this example but this general idea. So what would you guys favor 1 type or 3 types in this scenario?
-
We have to create some integration web services and were thinking about best practices. Should we favor flattening out the object model or be verbose (leave less room for interpretation/error)? Example 1. Complex Types – The employeeListItem would be used to provide summary information about the employees. The salaryEmployee and hourlyEmployee would be used to provide details. (‘Salary’ or ‘Hourly’) Example 2. Flatten objects – Just one type here all the details are provided in one object. When an employee is of type ‘Salary’ the ‘hourlyRate’ and ‘hoursPerWeek’ will be unused. (‘Salary’ or ‘Hourly’) Of course our objects are not as simple as this example but this general idea. So what would you guys favor 1 type or 3 types in this scenario?
There's a lot more to this question than this. Is this object going to be used on its own, or is it going to be in a collection? Instinctively I'd go with a normalised version of the object, but it really does depend on a lot of other factors. In the end, you're going to have to do a bit of profiling and work out what the size of the object you are going to be passing over the wire is, and if it's acceptable to you. Unfortunately, there's no magic bullet that we can apply here. This one's up to you.
Deja View - the feeling that you've seen this post before.