I had a discussion with a co-worker, he really fancies REST a lot, but I still have to be convinced of the benefits.My main issue is that I do not really see REST as an API, or interface in general, from a consuming application point of view. Let me elaborate. We have two applications where one calls the other using a RESTful API. This is implemented using JAX-RS and RESTeasy. Using RESTeasy though, it's pretty trivial to also generate a REST client based off of the interface.So let's say it's a system dealing with books and authors. The application needs to know about a book and let's assume it already knows some ID.
- In REST, it would call for example \[code\]http://server/book/21\[/code\], get returned an arbitrary payload and deserialise it into a \[code\]Book\[/code\] object.
- Using the RESTeasy client, we have an interface \[code\]BookService\[/code\] with a method \[code\]Book getBook(int bookId)\[/code\], we simply call \[code\]getBook(21)\[/code\] and get returned a \[code\]Book\[/code\] object.