java - Data model in a common web service -


in common restful service, there @ least 3 models, refer same thing, little different in different situation.

  1. the first model used accept data post request, field template_id valued "id12345".

  2. the second model db entity, have db entity, have template_id field, type of field int, it's internal template primary key in db, it's integer.

so can't directly convert post data db entity insert db.

  1. the third model rest response, example, want add/remove field in model. can't directly convert db entity json response.

so want know way process small differences between these 3 models.

do need create 3 models named postdatamodel dbmodel responsemodel? think it's not idea.

the post data , rest response may same, both belongs representation layer.

there example here. restlet-tutorial


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -