samples: why naming the processor classes XXXResource?

Topics: Web Api
Oct 12, 2011 at 7:53 PM

May this is a bit nit-picky, but i think naming the sample classes e.g. ContactsResource will create confusion about some well defined notions.

A resource is "the intended conceptual target of a hypertext reference" [1] and has a resource identifier (URL). Obiously the "ContactsResource" class

is not a resource. First of all, the class has no URL (Template) attached and furthermore a resource is more comparable to an object

("today´s weather in chicago" and not "weather" in general).

 

It is maybe a "ContactsController", which would be nicley fit to the notions in the MVC Pattern (and framework).

 

[1] http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_2    (especially 5.2.1.1)

Coordinator
Oct 12, 2011 at 7:59 PM

Which sample are you talking about? In preview 5 I think we updated all our samples to use "Api" in the name i.e. "ContactsApi"

Oct 12, 2011 at 8:53 PM
Edited Oct 12, 2011 at 8:54 PM

I still saw it in the latest source code bits (cd5d28e80e57)... I´ve looked again and it´s only in some of the samples.

If you are already aware of this issue, i´m happy :)  -  "Api" is nice, too...

 

By the way, i´m happy that Web/REST APIs are finally getting attention to microsoft. And as far as i can tell atm, you did a good job!

Coordinator
Oct 12, 2011 at 9:04 PM

Looks like HttpHelloResource still uses this naming convention. Am I missing any others?

Daniel Roth

From: humbrie [email removed]
Sent: Wednesday, October 12, 2011 12:54 PM
To: Daniel Roth
Subject: Re: samples: why naming the processor classes XXXResource? [wcf:275638]

From: humbrie

I still saw it in the latest source code bits (cd5d28e80e57)... I´ve looked again and it´s only in some of the samples.

If you are already aware of this issue, i´m happy :) - "Api" is nice, too...

By the way, i´m happy that Web/REST is finally getting attention to microsoft. And as far as i can tell atm, you did a good job!

Oct 13, 2011 at 7:12 AM

In the Projects CalendarEntry and WebApiSamples.Tests,

maybe for continuity "WeatherService" -> "WeatherApi" ?