构建你不会讨厌的API:人人都想拥有一个API,所以你应该学习如何构建它们。
API development is becoming increasingly common for server-side developers thanks to the rise of front-end JavaScript frameworks, iPhone applications, and API-centric architectures. It might seem like grabbing stuff from a data source and shoving it out as JSON would be easy, but surviving changes in business logic, database schema updates, new features, or deprecated endpoints can be a nightmare.
After finding many of the existing resources for API development to be lacking, Phil learned a lot of things the hard way through years of trial and error. This book aims to condense that experience, taking examples and explanations further than the trivial apples and pears nonsense tutorials often provide.
Phil worked primarily as an API developer for the last three years. One horror was managing an API built in FuelPHP by a freelancer at the million dollar startup he joined. It was utilizing a then deprecated ORM which had been hacked to death by the previous developer, so took the time to delete that mess and build the next version in Laravel, leveraging it's simple routing, database migrations, schema, seeding, etc. When the following major version of the API was built no rewrite was required, and both managed to live side-by-side on the same "API" servers.
By passing on some best practices and general good advice you can hit the ground running with API development, combined with some horror stories and how they were overcome/avoided/averted. This book will discuss the theory of designing and building APIs in any language or framework, with this theory applied in PHP-based examples.
Some of the more advanced topics covered here are endpoint testing, embedding data objects in a consistent and scalable manner, paginating responses (including embedded objects) and hypermedia "HATEOAS" controls.
API开发对于服务器端开发者来说,由于前端JavaScript框架、iPhone应用程序以及以API为中心的架构的发展越来越常见。乍一看,从数据源获取信息并将其转换为JSON似乎很简单,但要应对业务逻辑的变化、数据库模式更新、新功能或过时的端点却可能是一场噩梦。
在寻找许多现有的关于API开发资源时发现它们不够全面,Phil通过多年的试错学习了很多经验。这本书旨在浓缩这种经验,超越那些常提供不切实际的苹果和梨子教程中的例子。
Phil过去三年主要担任API开发者。一次恐怖的经历是他加入的那个百万美元初创公司的API管理一个由自由职业者构建在FuelPHP上的API。那时该框架已被前任开发者破坏得不成样子,所以他花时间清理了那个烂摊子,并在Laravel上重建了下一个版本,利用其简单的路由、数据库迁移、模式、种子等。当接下来的API主要版本被构建时,无需重写,两者都能同时在同一“API”服务器上运行。
通过分享一些最佳实践和通用建议,您可以以最快速的方式开始API开发,并结合一些恐怖故事及它们是如何克服或避免的。这本书将讨论在任何语言或框架中设计和构建API的理论,并应用于PHP基例的实例。
本文涵盖的一些高级话题包括:端点测试、以一致且可扩展的方式嵌入数据对象、分页响应(包括嵌入的对象)以及超媒体“HATEOAS”控制。
本站不对文件进行储存,仅提供文件链接,请自行下载,本站不对文件内容负责,请自行判断文件是否安全,如发现文件有侵权行为,请联系管理员删除。
Wireless Communications for Power Substations: RF Characterization and Modeling
Projective Geometry: Solved Problems and Theory Review (True PDF,EPUB)
Kingship and Government in Pre-Conquest England c.500–1066
Numerical Algorithms with C
Mathematical Modelling Skills
The Art of Encouragement: How to Lead Teams, Spread Love, and Serve from the Heart (True PDF)
Principles of Cybersecurity
React in Depth (True/Retail EPUB)
The Complete Obsolete Guide to Generative AI (True/Retail EPUB)
IT-Forensik: Ein Grundkurs