As promised and with only a month or so late, I begin this series of articles dealing with the themes of talk presented JavaDay to Rome on January 31. Anyone interested can find the complete movie here and here slides.
Well now we're off.
So, what is this rest that everyone is talking about? Hard to define, especially for the amount of noise that surrounds it. I take it a bit 'away. If you tried to ask the developer medium (without wishing to give a negative connotation to the term), you would get the answer might sound something like this:
"We need to make web services: use either soap or use rest"
try it!
Urge therefore dispel any misconception, starting by saying what Rest is not :
- There is a protocol (soap is).
- is not a framework, a product or a library.
- is nothing new.
- 's not just smoke.
But then what? According to the definition, REST (I will not use this more later in writing, even if it's very posh) is about to Representatinal State Transfer, a term coined by Roy Fielding in his doctoral thesis . Mr. Fielding is not exactly the newest. For one thing, it's one of those who worked the definition of the HTTP protocol. And looking at his personal homepage also seems like a humble and simple, the nerd next door.
I read the claim and found it very interesting, Mr. Roy will be happy to know. Rest the word appears for the first time in the fifth chapter, if I remember correctly, where it says that REST is an architectural style. The first four chapters explain what is meant by style architecture, how do you build one and why it makes sense to do so. The thing is a lot of theory and explains why the average developer, but with a latent market-oriented, could answer the above question with an answer smoky like "Rest is an architectural paradigm," saying something like this technically correct but in fact evading the question.
Ok, I'll stop beating about the bush and does not evade the question. REST is an architectural style. An architectural style is a set of constraints on communication between components in order to obtain benefits, a bond does not arise if there is something gained. So to set still must identify the constraints that it imposes, we must understand that the rules and for what purpose does it.