The final pattern for this book is another mechanism for cleaning up and optimizing the interface to a Web Service; it is similar to the Data Transfer Object pattern covered in Chapter 16, "Implementing the Data Transfer Object Pattern." In fact, you will use the Data Transfer Object pattern and sample implementation as a basis for the Partial Population pattern.
The basic motivation behind the Partial Population pattern is the observation that it is difficult to create the perfect granularity of data transfer objects for clients to use. Clients , and especially Web Service clients, rarely fit within the boundaries of what you provide them. For example, a user of customer information may want the customer summary information ( name and ID) along with the home address. Another Web Service user may want the customer summary information along with the mailing address, which is a different address from the home address. This is the same dichotomy of a product catalog; some users may want an image to accompany data in a product catalog, and other clients may want merely the data. By not transferring an image with every product catalog entry, you can save several megabytes of transferred data with each product catalog query.
This chapter discusses strategies to ensure that a Web Service user receives the data they want in the most efficient way possible. This chapter also discusses some minor enhancements to the Data Transfer Object pattern that facilitate the Partial Population pattern. To illustrate the pattern, the chapter then uses sample code that is similar to the Data Transfer Object pattern sample implementation but that has been modified for the Partial Population pattern.