Prev | Current Page 316 | Next

Brad Ediger

"Advanced Rails"

RESTful design drives the architectural
decisions into noun territory. Noun selection tends to be domain-driven, while RPC
interfaces tend to be more implementation-driven, as they expose their procedures
(an implementation detail) as part of the interface. While RPC interfaces often need
an extra layer of indirection to separate the interface from the implementation, REST
cultivates a separation of interface and implementation by encouraging more abstract
interfaces.
Also, because REST distinguishes the idea of ???resource??? from ???representation,??? it is
easy to add new content types representing the same resource as new formats are
required. No architectural changes are required, as REST is based on a separation
between an abstract resource and its representations.
RESTful Rails | 209
Uniformity
One of the biggest advantages afforded by the REST guidelines is a uniform interface.
The verbs (in our case, the HTTPmethods) are universally uniform, across all
application domains. Content types, though not universal (they differ across
domains), are standardized and relatively well known.
The fact that you are limited to such a small set of methods may seem constraining,
but in practice it is not a major concern. Anything you would want to model can easily
be framed in terms of the CRUD operations. This way of thinking about the
world helps to push essential complexity into one part of an architecture, where it is
easily dealt with.


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