tags:

views:

95

answers:

1

I recently built an API and was often asked to replace the StringCollections i was returning by objects containing a single property, The reason being that it was easier to bind with a listview or other controls in ASP.Net.

Since the API was used by the web application, the Web service and the dataloader I decided on keeping the StringCollection as my return type.

The methods returned labels for groups or report names.

Did I make the right choice? In such a situation how do you go about justifying your choice?

+3  A: 

I don't think you should make your API more complicated than needed just to satisfy the limitations a data binding module.

But you could perhaps provide a wrapper class for a StringCollection that adapted it to the demands of the data binding module?

Edit: This wrapper should be considered part of the data-binding layer rather than your data API, since it is something created specifically to adapt to the databinding module. It is irrelevant to other consumers of your data (if I understand your description correctly).

JacquesB
I don't know if this would be considered as being part of the API or part of the next layer ?
Alexandre Brisebois