Skip to Content
持續交付|使用Java
book

持續交付|使用Java

by Daniel Bryant, Abraham Marín-Pérez
July 2019
Intermediate to advanced
480 pages
9h 35m
Chinese
GoTop Information, Inc.
Content preview from 持續交付|使用Java
280
| 第十章
雖然嚴格來說確實如此,但多數人都發現這種做法太難且沒價值,因而回去使用上述的
其中一種方法。因此,我們決定不在這本書中討論它,不過想要進一步研究的讀者可以
閱讀 Roy Fielding 的著作(
https://roy.gbiv.com
)。
在真正有需要時,才指定
API
版本
看完這一節之後,你可能會在每一個新端點(甚至既有的端點)前面加上
/v1
(或者,如果你選擇用內容類型來設定版本的話,改變所有端點的內
容類型)。事實上,即使你想要先做好處理 API 變動的準備,也不需要從
一開始就處理它們:如果你還要建立新服務以及做出許多決策,或許可以
延後處理版本,只要假設第 1 版代表“沒有版本”,等到(如果)你需要
處理變動時,再選擇版本系統。
多階段升級
前面的範例有服務在用戶端還沒有準備好使用新功能
之前
就提供了新功能,這意味著
你必須設法維持回溯相容性,無論是以回溯相容的方式進行變動,還是藉著建立新版的
API。你可能認為,如果你可以同時控制 API 的供應方與使用方的話,就可以繞過這種
麻煩,直接同時改變兩者,但是這種想法是錯的。
即使你可以同時改變兩者,也不保證變動可以在生產環境中同時生效。一方面,你的部
署策略可能會讓供應方的新舊版本的某段時間內,在生產環境中同時存在,如果你的用
戶端只能配合新版本,它就會在部署期間遇到嚴重的中斷。另一方面,你會在第 11
看到,你的變動需要經歷多個測試階段,或許那些測試對供應方而言是通過的,但是對
使用方而言不是如此(或反過來),也就是說,生產環境的供應方與使用方有版本不符 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey
精通機器學習|使用Python

精通機器學習|使用Python

Sarah Guido, Andreas C. Mueller
数字化转型:企业破局的34 个锦囊

数字化转型:企业破局的34 个锦囊

Gary O’Brien, Xiao Guo, Mike Mason

Publisher Resources

ISBN: 9789865021740