java - Spring Hateoas - REST clients need have model classes + resource classes -


we have implemented restful web service using spring hateoas project. project makes easy convert domain classes resources provides "self" links etc.

what find confusing approach return resources classes when using get, when comes post or put use domain model. means client using restful api need have access domain classes + resource classes (resulting in clients having add hateoas project dependency). approach can seen in this blog entry.

what correct approach here? work resources classes (for posts , puts well)?

not each domain class has matching resource. take case object graph more complicated , resource has list of child object:

public class storeresource {     public string name;     public list<location> children; } 

the location object wouldn't have resource class.

for looks need provide both domain classes + existing resource classes clients.


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -