background preloader

Discussions

Facebook Twitter

Killer Apps, Killer Whales & Evolving With Your Code. Do we need WADL? Everybody's atwitter about WADL, a description file for REST services, and since it's supposed to be RESTful I regularly get questioned about it. For this post I'm going to experiment and adopt Stephen O'Grady's Q&A style. My thanks to Patrick Mueller and Dave Johnson for volunteering to be guinea pigs for my arguments, and thanks to #redmonk for the use of their channel where we initially held the discussion. Q: Does REST need a description document? A: No. Q: You're new to this Q&A format, aren't you? A: There are, as always, two problems. The technical problems I will get back to later. The urge to code generate is particularly strong around XML Schema.

The second cultural hurdle is the implicit assumption that all useful data will be in the form of XML, which ignores the vast amount of non-XML content on the web today, which, outside of RSS and Atom, is all of it (HTML, CSS, JavaScript, podcasts, videos, JSON, etc.). A: Sure. Here is the very first example in the WADL specification: CQRS. Domain driven design · application architecture · API design tags: CQRS stands for Command Query Responsibility Segregation. It's a pattern that I first heard described by Greg Young. At its heart is the notion that you can use a different model to update information than the model you use to read information. For some situations, this separation can be valuable, but beware that for most systems CQRS adds risky complexity.

The mainstream approach people use for interacting with an information system is to treat it as a CRUD datastore. By this I mean that we have mental model of some record structure where we can create new records, read records, update existing records, and delete records when we're done with them. As our needs become more sophisticated we steadily move away from that model. As this occurs we begin to see multiple representations of information. There's room for considerable variation here. CQRS naturally fits with some other architectural patterns.

When to use it. PUT or POST: The REST of the Story « Open Sourcery. Web service designers have tried for some time now to correlate CRUD (Create, Retrieve, Update and Delete) semantics with the Representational State Transfer (REST) verbs defined by the HTTP specification–GET, PUT, POST, DELETE, HEAD, etc. So often, developers will try to correlate these two concepts–CRUD and REST–using a one-to-one mapping of verbs from the two spaces, like this: Create = PUTRetrieve = GETUpdate = POSTDelete = DELETE “How to Create a REST Protocol” is an example of a very well-written article about REST, but which makes this faulty assumption.

(In fairness to the author, he may well have merely “simplified REST for the masses”, as his article doesn’t specifically state that this mapping is the ONLY valid mapping. In the article, “I don’t get PUT versus POST” the author clearly understands the semantic differences between PUT and POST, but fails to understand the benefits (derived from the HTTP protocol) of the proper REST semantics. NOTE: “iff” means “if and only if”. Is REST the future for SOA? It seems like everywhere we turn we keep hearing that SOA’s future is REST. There are a lot of publications comparing REST to SOAP and WS*[1], but such comparison seems to be too simplistic. There are two main approaches that have emerged lately – true REST and REST as a technology approach for services (aka REST Web Services[2]).

In this article I will try to discuss whether either of these approaches can improve SOA implementations. True REST for SOA A true REST is effectively an implementation of Resource-Oriented architecture and not a pure technology decision. In order to assess the problem correctly, let’s first recall that the SOA architectural style [2] is based on a functional decomposition of enterprise business architecture and introduces two high-level abstractions: enterprise business services and business processes. REST, on another hand, is a set of architectural guidelines [3] expressed as Resource-Oriented Architecture (ROA). Services vs. What is a service? Simplicity 1. API Craft (google group)