SlideShare uma empresa Scribd logo
1 de 14
Designing APIs for Others Real World Lessons About  Commercial API Development
Typical Programming Goals Minimize maintenance cost & risk Extensible / refactorable to new requirements Easy to read the source code
Commercial API Goals Other people use your library and like it. Short First Reference -> First Wow Digestible, iterative discovery Easy Things are Easy, Hard Things are Possible
How Users Discover Code Samples Very narrow, taken literally IntelliSense Driven Discovery See that they probably can do what they want to.
Design Priorities Discovery through your fingers Where possible can’t be misused Don’t show what they don’t need Advanced features in advanced ways Hard Shell Designer->Compile->Runtime
Key Implementation Method Always outside in – terms, flow, exception types. Reads like the outline of a book Fewer, Flatter Sample Driven Development Samples are your test cases Digestible chunks of WHY Consistency
Inheritance Awkward IntelliSense Hardening Tricky Alternating viewpoints (External & Internal) Compromise Simplicity ,[object Object]
Customer Request Safety Net,[object Object]
Hardening Event  Pattern Property Transitions Inheritance
FxCop Catches all manner of subtle things You can ignore its advice – but know why Use of generic event handlers Exposing generic collections Samples too – don’t require users to break the rules
Packaging Fewer Assemblies Runnable Sample Solution Clear Redistribution Requirements Xml Help, PDB if feasible Unit tests if available
Common Mistakes Users aren’t as smart as you Domain knowledge Coding capability Internal / Tribe Language Inconsistent Framework + API + Experience Single Minded
Most Common Mistake You must have at least two, independent external teams use your API while it’s still changeable
Additional Information Book Framework Design Guidelines by Krzysztof Cwalina Websites www.GibraltarSoftware.com www.eSymmetrix.com Follow Up Kendall.Miller@eSymmetrix.com Twitter: kendallmiller

Mais conteúdo relacionado

Destaque

Destaque (11)

API Developer Experience: Why it Matters, and How Documenting Your API with S...
API Developer Experience: Why it Matters, and How Documenting Your API with S...API Developer Experience: Why it Matters, and How Documenting Your API with S...
API Developer Experience: Why it Matters, and How Documenting Your API with S...
 
Odoo - From v7 to v8: the new api
Odoo - From v7 to v8: the new apiOdoo - From v7 to v8: the new api
Odoo - From v7 to v8: the new api
 
K to 12 Mathematics Curriculum Guide for Grades 1 to 10
K to 12 Mathematics Curriculum Guide for Grades 1 to 10K to 12 Mathematics Curriculum Guide for Grades 1 to 10
K to 12 Mathematics Curriculum Guide for Grades 1 to 10
 
Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)
 
How Not To Get Noticed
How Not To Get NoticedHow Not To Get Noticed
How Not To Get Noticed
 
Stress At Work (Tips to Reduce and Manage Job and Workplace Stress)
Stress At Work (Tips to Reduce and Manage Job and Workplace Stress)Stress At Work (Tips to Reduce and Manage Job and Workplace Stress)
Stress At Work (Tips to Reduce and Manage Job and Workplace Stress)
 
RESTful API Design, Second Edition
RESTful API Design, Second EditionRESTful API Design, Second Edition
RESTful API Design, Second Edition
 
Top Office Etiquette Mistakes
Top Office Etiquette MistakesTop Office Etiquette Mistakes
Top Office Etiquette Mistakes
 
Work Hacks : Body Language
Work Hacks : Body LanguageWork Hacks : Body Language
Work Hacks : Body Language
 
12 Days of Productivity
12 Days of Productivity12 Days of Productivity
12 Days of Productivity
 
Thai tech startup ecosystem report 2017
Thai tech startup ecosystem report 2017Thai tech startup ecosystem report 2017
Thai tech startup ecosystem report 2017
 

Mais de Gibraltar Software

Introducing Agile to the Enterprise
Introducing Agile to the EnterpriseIntroducing Agile to the Enterprise
Introducing Agile to the Enterprise
Gibraltar Software
 

Mais de Gibraltar Software (7)

Scaling Systems: Architectures that grow
Scaling Systems: Architectures that growScaling Systems: Architectures that grow
Scaling Systems: Architectures that grow
 
Introducing Agile to the Enterprise
Introducing Agile to the EnterpriseIntroducing Agile to the Enterprise
Introducing Agile to the Enterprise
 
The raspberry pi – building an internet radio
The raspberry pi – building an internet radioThe raspberry pi – building an internet radio
The raspberry pi – building an internet radio
 
Connecting to the raspberry pi from your laptop
Connecting to the raspberry pi from your laptopConnecting to the raspberry pi from your laptop
Connecting to the raspberry pi from your laptop
 
Setting uptheraspberrypiusingberryboot
Setting uptheraspberrypiusingberrybootSetting uptheraspberrypiusingberryboot
Setting uptheraspberrypiusingberryboot
 
Natural Laws of Software Performance
Natural Laws of Software PerformanceNatural Laws of Software Performance
Natural Laws of Software Performance
 
Software Company Survival Guide
Software Company Survival GuideSoftware Company Survival Guide
Software Company Survival Guide
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Designing APIs for Others

  • 1. Designing APIs for Others Real World Lessons About Commercial API Development
  • 2. Typical Programming Goals Minimize maintenance cost & risk Extensible / refactorable to new requirements Easy to read the source code
  • 3. Commercial API Goals Other people use your library and like it. Short First Reference -> First Wow Digestible, iterative discovery Easy Things are Easy, Hard Things are Possible
  • 4. How Users Discover Code Samples Very narrow, taken literally IntelliSense Driven Discovery See that they probably can do what they want to.
  • 5. Design Priorities Discovery through your fingers Where possible can’t be misused Don’t show what they don’t need Advanced features in advanced ways Hard Shell Designer->Compile->Runtime
  • 6. Key Implementation Method Always outside in – terms, flow, exception types. Reads like the outline of a book Fewer, Flatter Sample Driven Development Samples are your test cases Digestible chunks of WHY Consistency
  • 7.
  • 8.
  • 9. Hardening Event Pattern Property Transitions Inheritance
  • 10. FxCop Catches all manner of subtle things You can ignore its advice – but know why Use of generic event handlers Exposing generic collections Samples too – don’t require users to break the rules
  • 11. Packaging Fewer Assemblies Runnable Sample Solution Clear Redistribution Requirements Xml Help, PDB if feasible Unit tests if available
  • 12. Common Mistakes Users aren’t as smart as you Domain knowledge Coding capability Internal / Tribe Language Inconsistent Framework + API + Experience Single Minded
  • 13. Most Common Mistake You must have at least two, independent external teams use your API while it’s still changeable
  • 14. Additional Information Book Framework Design Guidelines by Krzysztof Cwalina Websites www.GibraltarSoftware.com www.eSymmetrix.com Follow Up Kendall.Miller@eSymmetrix.com Twitter: kendallmiller

Notas do Editor

  1. Your biggest competition is the user’s belief in the difficulty of solving the problem.
  2. Misuse prevention: Thread safety, order of operations, types, null behaviorsDon’t show what they don’t need: Internal, hide on interfaces, veneer the APIHard Shell: Don’t trust any code around or above you.
  3. Consistent with the framework and itself, then with likely customer experience.
  4. Prefer to have the fewest assemblies you can, and their names are part of their interface.Use different names for valid combinations – like .NET 20 and .NET 40. Have a reason for the CUSTOMER that you broke apart
  5. Your job is to hide the complexity of your domain from users, not show how smart you areQuality is tightly related to how well it blends into the enviornmentYour preferences aren’t their preferences – configuration, designer or code