W3C home > Mailing lists > Public > ietf-http-wg@w3.org > January to March 2012

Re: [p3-payload] Media-Type -- Two Values, One Cup Anti-Pattern?

From: Ray Polk <raypolk@gmail.com>
Date: Tue, 17 Jan 2012 14:27:54 -0700
Message-ID: <CABqtACYoLnSQiDyG-MRJComt2DD8tj1SU5O0fCWTao0awW8wAg@mail.gmail.com>
To: "Roy T. Fielding" <fielding@gbiv.com>, Robert Bergman <robert.bergman@gmail.com>
Cc: ietf-http-wg@w3.org
Thanks for the correction.  To be sure I understand, I'll paraphrase your
response:

Media types are a key used by user agents to look up processing
instructions with a registered authority (iana for http).  Though these
processing instructions might include anything, many (all?) include format
information; further, many include _only_ format information.  As a result,
a practice arose of naming the key after the format.


Perhaps my mistake confused the main point I was trying to make, though.  I
wasn't concerned with the number of media types that are applicable to an
end point.  My concern was with the ramifications of including data
semantics in the processing mechanism along with the format information.

By combining the two, the number of total registered types can/could
increase geometrically.  The vnd.openxmlformats-*+xml formats are an
example of that potential.  Imagine if someone registers openjsonformats &
openyamlformats.  Then they want both text and binary formats.  The list of
~75 types at the end of this email becomes 400+.

Now imagine the growth as such a practice spreads to other domains AND as
the number of popular text formats grows...

Endpoints and clients dealing with format+datatype media types would be
repeating themselves over and over again.  Imagine the Accept headers...

To put it another way, can I register vnd.cat-jpeg? :-)  Should I?


Sure, a design that allows endpoints to supply user agents a key to lookup
processing instructions maximizes flexibility.  Catch-all text columns,
member variables and void pointers all also maximize flexibility.

When in practice, though, ~100% of those catch-alls include format
information.  Isn't it time for a more strongly typed header/column/member?
 (to go along witth the catch all)

-Ray


(for reference, these are the Media Types to which I'm referring above when
I say "openxmlformats":

<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.custom-properties+xml>
vnd.openxmlformats-officedocument.customXmlProperties+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.customXmlProperties+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.drawing+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.drawing+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.drawingml.chart+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.drawingml.chart+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.drawingml.chartshapes+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.drawingml.diagramColors+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.drawingml.diagramData+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.extended-properties+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.extended-properties+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.comments+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.comments+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.notesMaster+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.notesSlide+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.presentation<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.presentation>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.presentation.main+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.presProps+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.presProps+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.slide<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.slide>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.slide+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.slide+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.slideLayout+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.slideMaster+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.slideshow<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.slideshow>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.tableStyles+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.tags+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.tags+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.template<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml-template>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.template.main+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.template.main+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.presentationml.viewProps+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.comments+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.connections+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.sheet<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.styles+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.table+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.template<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml-template>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.theme+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.theme+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.themeOverride+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.themeOverride+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.vmlDrawing<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.vmlDrawing>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.comments+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.document<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.document>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.footer+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.settings+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.styles+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.template<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml-template>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-package.core-properties+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-package.core-properties+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-package.digital-signature-xmlsignature+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]
vnd.openxmlformats-package.relationships+xml<http://www.iana.org/assignments/media-types/application/vnd.openxmlformats-package.relationships+xml>
[Murata <http://www.iana.org/assignments/contact-people.htm#Murata>]

)

On Fri, Jan 6, 2012 at 2:05 PM, Roy T. Fielding <fielding@gbiv.com> wrote:

> On Jan 6, 2012, at 12:59 AM, Ray Polk wrote:
>
> > I had a question about the evolution of media types.
> >
> > Early media types constrained themselves strictly to describing the
> format (syntax) of the representation (image/png, application/xml).
>
> No, media types have always described the intended MUA (MIME user agent)
> processing.  They are named after data formats because most of the time
> there is a 1:1 correlation between format and intended processing
> mechanism.
> Regardless, for any given data format there are at least two and often
> three different media types that might apply.  For example, most HTML
> is equally valid as text/html, text/plain, or application/octet-stream.
> The only difference is how the sender intends that the recipient
> should process the message.
>
> ....Roy
>
>
Received on Tuesday, 17 January 2012 21:28:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 06:51:52 GMT