TheOpenCloudEngine / uEngine5-base

uEngine5 BPMS that totally re-written in Microservices architecture. uEngine5 can act as not only a conventional Workflow or BPMS but also as a REST api orchestrator or a BPaaS (Business process as a service) of members of OCE's MSA components.
MIT License
10 stars 13 forks source link

API Pattern Standard Decisions (표준화 관련 결정 사항) #27

Open jinyoung opened 6 years ago

jinyoung commented 6 years ago
  복수형:  http://localhost:8080/instance  의 _embedded.instances 값을 가지고 옴
  단수형:  http://localhost:8080/instance/{id} 로 id 값을 넘겨서 받아옴

현재 표준에 따라 변경되어야 하는 url 들:

 ProcessInstanceRepository --> path="instance" 로 변경 필요
 WorkListRepository --> collectionResourceRel="worklists" 로 변경 필요
 RoleMappingRepository --> collectionResourceRel = "rolemappings" 로 변경 필요
jinyoung commented 6 years ago

동반하여, 기존 UI (vueJS 코드) 들도 변경 필요함.

11월에 일괄 적용

jinyoung commented 6 years ago

https://blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/

모든 참여자들 꼭 위의 가이드라인 보시고 api 설계시 준수 바랍니다

jinyoung commented 6 years ago

Hateoas 방식으로 전환한 샘플:

jinyoung commented 6 years ago

Hateoas 의 API checkpoints:

  1. 한번의 진입점 (aggregation root) 에 대한 url 정보만으로 모든 이후의 액션과 association 데이터들은 _links 를 통하여 accessible 해야 한다. 따라서, front 와 back-end 는 가능한 변경에 대하여 분리가 이루어져야 한다.

  2. 클라이언트 (자바스크립트)는 명시적인 uri pattern 에 대한 템플릿을 구성하여 uri 를 생성해서는 안된다. 가능한 데이터가 자신의 self url 과 자신의 행위에 대한 url 을 쥐고 다니도록 구현한다. 즉, hybind 나 traverson 같은 라이브러리를 사용한다.