rest - Restful way to validate a resource -
imagine have resource of special case of e-commerce application /cart in api supports crud operations: get, post
i want have service validates if cart correct (stock availability, etc...) need cart information, don't want store partial states of cart, that's why put not supported resource.
the question method , path correct kind of service in restful way?
i think if want build restful web service, should not bind business logic in it.
restful service should think infrastructure of system. provides consistent api allow others access resource.
you build bussiness layer upon restful resources, in layer can complex business logic, example, checking stock availability(maybe underlying accessing stock resource), or making payment(maybe underlying accessing payment resources , product resources)
Comments
Post a Comment