Now let us try to explain this concept by taking an example. Let us consider we are developing a Web Service to retrieve Employee Details. Employee has the following associated characteristics
1) Dependents (An Array of Persons)
2) Skills (An Array of Skills)
3) Peers (An Array of Employees)
4) Direct Reports (An Array of Employees)
So when designing the Web Service to retrieve the employee, you have multiple ways of designing the Web Service.
Fine grained Approach
Figure below illustrates what is known as the “Fine grained” approach.
The biggest advantage of this approach is that, there is great flexibility in what client wants to get from the Web Service. If a Client is interested in getting Only Employee Skills that can be accomplished very easily by calling the corresponding web method. The problem though is that if a Client wants to get the Entire details of the Employee, there has to be 5 calls made to the Web Service provider, which increases the amount of Network traffic. Each Network call made is costly and can also affect performance negatively.
Coarse grained approach
Figure below illustrates what is known as the “Coarse grained” approach.