22. @Controller
@RequestMapping("/boards")
public class BoardController {
@ResponseBody //
@RequestMapping(method = RequestMethod.POST)
public Board post(@RequestBody Board board) {};
@ResponseBody // 譟壱
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public Board get(@PathVariable("id") Long boardId) {};
@ResponseBody //
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public Board put(@PathVariable("id") Long boardId,
@RequestBody Contents contents) {};
@ResponseBody //
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public void post(@PathVariable("id") Long boardId) {};
}
Controller
23. @Service
@Transactional
public class BoardService {
public Board new(Board board){}; //
public Board get(Long boardId){}; // 譟壱
public Board update(Board board){}; //
public void remove(Long boardId){}; //
}
Service
蠏碁 企蟆
ろ語 誤壱伎る 襷 REST API襯
Spring Data REST襯 牛 企至 所 觜襯願 螳ク蟆 螳覦 讌 覲願給.
Spring Data REST REST API襯 所 觜襯願 襷り鍵 蠍一.
轟 Spring Data REST襯 覿 螻螳? 覃 螳語朱 覲伎覿?
企慨讌 殊企 覦襯 れ殊螻 Spring Data REST螳 覓伎語, 企至 讌 螳朱 譬蟆給.
れ Spring Data REST 覈 螳讌 轟 覲願給.
Spring Data 螻牛 Repository 誤壱伎 襷朱 REST API襯 襷 給.
Repository 誤壱伎れ 覃 碁朱 蟆 API螳 螻給.
Spring Data 覃襯 貎朱Μ 覃手 一.
貎朱Μ 覃 Spring Data 螻牛 覓碁 磯 覃覈 覃 覃覈 蠍一朱 譟壱貎朱Μ襯 襷り 譟壱貎朱Μ螳 蟆 API襦 螻給.
Projection 壱一 一危磯ゼ れ蟆 螻 蠍磯レ.
HATEOAS Hypermedia As The Engine Of Application State 曙.
HATEOAS 襴貅伎 螳ロ
1. 一危 覈語 覃一危磯,
2. 襷覲,
3. 襴 煙 Response Body襦 蠍磯レ.
轟 伎手鍵襯 覃伎 Spring Data 伎 覈覯 瑚 蟾 る 伎 蟇 螳給.
Spring Data Data 伎企ゼ 豢 襦語.
磯Μ螳 襷 jpa mongodb, redis 螳 蟲豌企れ 磯Μ螳 讌 蟲讌 螻 Spring Data 企 襷れ伎 蟲豌企ゼ 蟆 誤壱伎るゼ 螻牛.
1. Spring Data REST Spring Data API Spring Web MVC API螳 蟆壱 襦語.
2. Spring Data 一危 伎企ゼ 豢り 一.
Spring Data REST 豢 一危 伎企ゼ REST API襦 螻牛 蠍一.
3. 讀 no_sql レ襯 覲企 覦襦 REST API襯 螻牛 蟆曙郁 襷 蠏碁 覩語 覲企 Spring Data REST れ レ襯 豢襯 螻 覦襦 REST API襦 蠍一.
蠏碁Μ螻 Spring Data REST JPA, Gemfire, MongoDB, Redis, Solr() 企蟆 豐 5螳讌 蠍一 讌螻
る Spring Data JPA襯 蠍一朱 る
Spring MVC Spring Data REST襦 蟆 REST API襯 襷 貊襯 觜蟲企慨蟆給.