• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RESTful Service with JAX-RS 2.0 Video question

 
Ranch Hand
Posts: 572
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Alex,


What are advantages of using  JAX-RS 2.0 with or without frameworks like Spring or Jersey ?
Another way of putting it ,what do the frameworks provide that the reference implementation does not?

thank you,
Paul
 
Author
Posts: 116
11
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul

JAX-RS 2.0 is a specification (JSR339) and Jersey is the reference implementation for this specification. There are other implementations of JAX-RS 2.0 which include RESTEasy, and Apache CXF. The implementations must provide AT LEAST the functionality that the specification details and therefore portable. You should be able to swap out one implementation for another and your application will continue to work (as long as you didn't use any implementation specific features). JAX-RS implementations often offer more than the minimum required by the specification with features that are specific to that implementation.

Spring Rest is Pivotal's implementation of the REST pattern and is not a JAX-RS implementation, however, integration is possible.

The benefit of using a JAX-RS implementation is that as long as you use only the features specified in the spec you can change the implementation after the application has been developed and without refactoring code. Additionally, and more important, is that because JAX-RS implementations implement the same interfaces it is much easier to learn another JAX-RS implementation.

So an endpoint, as shown in the code snippet below, is programmed like this in all JAX-RS implementations. Its the same in Jersey, RESTEasy and so on.


Therefore learning JAX-RS means you learn all the specific features that all the JAX-RS implementations implement.


 
paul nisset
Ranch Hand
Posts: 572
2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Alex,
Thanks for the clarification and the differentiation of Spring from some of the other well known REST frameworks.
It definitely makes sense to learn a specification that many implementations use.
-Paul
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic