Prev | Current Page 317 | Next

Brad Ediger

"Advanced Rails"

Usually, when it seems that you need more than the basic methods,
there is another entity lurking in the model, waiting to be extracted.
Content types are standardized in a different way. Content types are usually somewhat
application-specific, and so it would make no sense for them to be universal.
However, to facilitate communication, content types are usually somewhat standard.
In the HTTPworld, this means MIME (Multipurpose Internet Mail Extensions),
an Internet standard that defines a framework for content types. The set of
MIME types is extensible, so new applications can define local types and even register
them with the IANA once they are in widespread use.
The uniformity that REST provides tremendously aids standardization efforts. When
bringing multiple systems together (as happens when developing a standard), the
fewer differences there are, the fewer political disagreements. If everyone standardizes
on a set of verbs (which are universally standardized when using HTTP), then the
only differences that remain are the content types (which are fairly straightforward to
standardize within an application domain) and nouns.
Therefore, complying with a RESTful interface helps to reduce the huge problem of
standardization to the somewhat more manageable problems of representing data
(content types) and naming things (nouns). Though these are still areas where disagreement
and politics can interfere, the principles of REST help to focus the discussion
by narrowing the topics of discussion.


Pages:
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329