REST笔记

Resources :

Roy Fielding

  • http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
  • http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven

Martin Fowler

  • https://martinfowler.com/articles/richardsonMaturityModel.html
  • http://www.rgoarchitects.com/Files/fallacies.pdf

Digest :

Comparasion :

  • RPC API
  • Message API
  • Resource API

Representational State Transfer

  • Application States Transfer among the Resource's Representation
    • Application States : stem from Resource State;
    • Representation : Representation of Resources - format;
    • Transfer : between Client and Server;
  • Uniform Interface :
ConstaintsDescriptionOO
  • Identification of Resources

URI = Object Reference

Resource = Object

Class/Object
  • Manipulation of Resources through Representations
A representation of resource in a particular format, XML, JSON, CSV, etcCollection of Fields 
  • Self-Descriptive Message
Metadata sent back to client to intepret the response, also the info needed for making next call  
  • Hypermedia as the engine of application state
Connectedness/linkage; List of Methods: What method that a object can invoke, on the provided fields, etc;
  • Stateless : client, rather than server, maintain all the necessary info for making the next request;

Maturity Level :

RMM, while a good way to think about what the elements of REST, is not a definition of levels of REST itself. Roy Fielding has made it clear that level 3 RMM is a pre-condition of REST.

LevelDefinitionExplaination
0HTTP merely used as transport prorocollike RPI, method, format, response, are all up to users to define
1Resourcestackles the question of handling complexity by using divide and conquer, breaking a large service endpoint down into multiple resources.
2Leverage HTTP Verbs and Response Codeintroduces a standard set of verbs so that we handle similar situations in the same way, removing unnecessary variation.
3Hypermedia Controlsintroduces discoverability, providing a way of making a protocol more self-documenting.

 

转载于:https://my.oschina.net/u/3551123/blog/979141

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值