locked
Integration Services RRS feed

  • Question

  • 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.

        <employeeListItem>
            <employeeId/>
            <firstname/>
            <lastname/>
            <type/> (‘Salary’ or ‘Hourly’)
        </employeeListItem >
       
        <salaryEmployee>
            <employeeId/>
            <firstname/>
            <lastname/>
            <dateOfHire/>
            <officeId/>
            <salary/>
        </salaryEmployee >
       
        <hourlyEmployee>
            <employeeId/>
            <firstname/>
            <lastname/>
            <dateOfHire/>   
            <officeId/>
            <hourlyrate/>
            <hoursPerWeek/>   
        </ hourlyEmployee >

    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.

        <employee>
            <employeeId/>
            <firstname/>
            <lastname/>   
            <officeId/>
            <type/>(‘Salary’ or ‘Hourly’)
            <salary/>
            <hourlyRate/>
            <hoursPerWeek/>   
        </ employee >


    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?

    Tuesday, March 11, 2008 9:37 PM

Answers

  • sprague295,

    To me, this brings the 'Contract-First' phrase to mind.  So the question is, thinking about it from a legal contract perspective, would you rather have one that leaves room for interpretation ('make consistent payments'), or one that clearly defines the intent and what was agreed upon ('make 25 monthly payments of $1 starting on...').  Of course, as with legal documents, more verbose means more work (and money).

    I would personally choose 3 types, especially if the serialization capabilities of .NET were to be used.  That said, if this were to be a high-performance application (lots of bandwidth), I might choose the 1 type option.

    Hope this helps,


    Steve - www.platinumbay.com
    Wednesday, March 12, 2008 2:07 AM

All replies

  • sprague295,

    To me, this brings the 'Contract-First' phrase to mind.  So the question is, thinking about it from a legal contract perspective, would you rather have one that leaves room for interpretation ('make consistent payments'), or one that clearly defines the intent and what was agreed upon ('make 25 monthly payments of $1 starting on...').  Of course, as with legal documents, more verbose means more work (and money).

    I would personally choose 3 types, especially if the serialization capabilities of .NET were to be used.  That said, if this were to be a high-performance application (lots of bandwidth), I might choose the 1 type option.

    Hope this helps,


    Steve - www.platinumbay.com
    Wednesday, March 12, 2008 2:07 AM
  • More on Integration I suggest to visit the MSDN Architecture Center dedicated page
    Tuesday, April 8, 2008 8:35 PM