java - Data model in a common web service -
in common restful service, there @ least 3 models, refer same thing, little different in different situation.
the first model used accept data post request, field
template_id
valued "id12345".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.
- 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
Post a Comment