rest - For RESTful services in Java, is JAX-RS better than an MVC framework like Swing, Grails or Play? -
for example, play-framework supports restful services this: restful on play! framework
how compare jax-rs jersey implementation? framework play run circles around jersey because of it's cool bells , whistles, , rest too?
developer productivity important, proper implementation. perhaps using mvc framework rest services 'wrong'?
note, restful services, no ui components @ all.
even though it's not "wrong" use mvc framework restful services, there pros , cons versus using jax-rs implementation.
(disclaimer: have used jersey , play! fun, , not on production-grade systems, have tailored comments more mvc vs. jax-rs. keep in mind these broad generalizations.)
mvc frameworks--at least ones considered developer friendly , "slick"--typically save having build persistence layer (the model part). simplify "routing" requests using either scaffolding via convention or form of configuration. downsides have conform conventions controllers , have write view each resource (or build layers of abstractions avoid rewriting same code).
jax-rs excels @ defining routing (using java annotations) eliminating restrictions on service class. in experience, has reduced amount of boilerplate code , developer overhead. jersey , apache cxf handle xml or json serialization using jaxb annotations, eliminates need figure out view in mvc context. downside here have figure out own orm or persistence layer, or bad depending on whether you're building on top of existing data or creating greenfield system (or using other jpa/rdbms e.g. nosql data store).
my own personal comment: play! cool framework, i'd choose cxf (or jersey) on mvc framework day building out restful service. in experience, frees developer focus on logic needed service, , opens options different database approaches. right tool right job.
Comments
Post a Comment