|
Thanks for joining the discussion, Jerome, we were getting a bit ridiculous in trying to second guess your intentions. :) It makes sense to me to use simple strings for referring to media types, and your examples are definitely elegant. But I have to again say that using filename extension names is bizarre, and would confuse users. What do filename extensions have to do with this particular use case?
Related
to this is that, indeed, not all MediaTypes have filename extensions,
so they can't even be used with the current annotation system. Case in
point: "application/w-www-form-urlencoded",
a very standard MIME type that browsers send from form submits. I can
see wanting to return such representations for proxy/robot applications.
Perhaps
we can call it MetadataService.getShortcut()? And register names for
all media types, which may be similar to but not dependent on filename
extensions? (The above, for example, could be shortcutted as "form".) I
think "shortcut" is a generic enough term that it can be used
throughout Restlet without confusion. In fact, anywhere that a full
MIME type string is accepted, we could allow shortcuts to be used
instead.
I
hope you address another point I raised -- that ServerResource should
fail somewhere with an exception in case the annotation's configuration
string is invalid. For example, a media type extension unrecognized by
MetadatService. Right now, anything is accepted cheerfully and the user
has no clue as to what went wrong. @Get("wtf") slides through. I've
tested this. :)
-Tal
|
- Re: Restlet 1.2 M2 released Jonathan Hall
- RE: Restlet 1.2 M2 released Jerome Louvel
- Re: Restlet 1.2 M2 released Jonathan Hall
- Re: Restlet 1.2 M2 released Stephan Koops
- Re: Restlet 1.2 M2 released [throw previous... Stephan Koops
- Re: Restlet 1.2 M2 released [throw pre... Paul Austin
- Re: Restlet 1.2 M2 released [throw... Tal Liron
- Re: Restlet 1.2 M2 released [throw... David Fogel
- Re: Restlet 1.2 M2 released [throw... Tal Liron
- RE: Restlet 1.2 M2 released [throw... Jerome Louvel
- Re: Restlet 1.2 M2 released [throw... Tal Liron
- RE: Restlet 1.2 M2 released [throw... Jerome Louvel
- Re: Restlet 1.2 M2 released [throw... Tal Liron
- RE: Restlet 1.2 M2 released [throw... Jerome Louvel
- Re: Restlet 1.2 M2 released [throw... Tal Liron
- Re: Restlet 1.2 M2 released [throw... Rémi Dewitte
- Re: Restlet 1.2 M2 released [throw... Tal Liron
- Re: Restlet 1.2 M2 released [throw... David Fogel
- RE: Restlet 1.2 M2 released [throw... Jerome Louvel
- Re: Restlet 1.2 M2 released [throw... Paul Austin
- RE: Restlet 1.2 M2 released [throw... Jerome Louvel

