Can web services be effectively categorized as extensions of the presentation/web layer or the biz/data layer?
It may appear to be a simple question. After all, they are called web services, implying they belong to the web tier. However, as I work on developing a standard webform with some AJAX functionality, I find myself contemplating two approaches for building web services:
- One option is to have the web services retrieve data for me (an extension of the biz/data layer). For example:
GetUserData(userEmail)
, where the web form's javascript processes the data and updates the markup accordingly. - The other possibility is for the web services to return fully rendered user controls (html; an extension of the web layer). For instance:
, with the web form's javascript simply adding the service's html to the form.RenderUserProfileControl(userEmail)
Both scenarios could potentially work, but I am curious to hear different perspectives on this matter. What are your thoughts?