Spring Data Rest Without HATEOAS -
i boilerplate code spring data rest writes you, i'd rather have 'regular?' rest server without hateoas stuff. main reason use dojo toolkit on client side, , of widgets , stores set such json returned straight array of items, without links , things that. know how configure java config mvc code written me, without hateoas stuff?
so want rest without things make rest? :) think trying alter (read: dumb down) restful server satisfy poorly designed client library bad start begin with. here's rationale why hypermedia elements necessary kind of tooling (besides familiar general rationale).
exposing domain objects web has been seen critically of rest community. reason boundaries of domain object not boundaries want give resources. however, frameworks providing scaffolding functionality (rails, grails etc.) have become hugely popular in last couple of years. spring data rest trying address space @ same time citizen in terms of restfulness.
so if start plain data model in first place (objects without many relationships), want read them, there's in fact no need spring data rest. spring controller need write 10 lines of code on top of spring data repository. when things more challenging story gets becomes more intersting:
- how write client without hard coding uris (if did, wasn't particularly restful)?
- how handle relationships between resources? how let clients create them, update them etc.?
- how client discover query resources available? how find out parameters pass etc.?
if answers these questions is: "my client doesn't need / not capable of doing that.", spring data rest wrong library begin with. you're building json on http, nothing restful then. totally fine if serves purpose, shoehorning library clear design constraints arbitrary different (albeit apparently similar) wants ignore these design aspects wrong approach in first place.
Comments
Post a Comment