Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Practices	
  and	
  Tools	
  for	
  Building	
  Better	
  APIs

	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
...
Objectives	
  of	
  this	
  talk
• API	
  from	
  a	
  Java	
  app	
  developer	
  perspective	
  
!

•
•
•
•

Why	
  API	...
Some	
  API	
  terminology
• API	
  Consumer:	
  code	
  that	
  uses	
  API	
  
• API:	
  the	
  interface	
  
• API	
  I...
We	
  are	
  using	
  a	
  lot	
  of	
  API
Bazillion	
  Open	
  
Source	
  Web	
  
Framework	
  API’s	
  
Spring:	
  27	
...
We	
  are	
  building	
  more	
  of	
  them,	
  too
• API	
  is	
  key	
  to	
  a	
  succesful	
  module	
  design	
  
– E...
Distance	
  to	
  API	
  implementation	
  is	
  increasing
• API	
  quality	
  increasing	
  important	
  when	
  
implem...
The	
  API	
  we	
  use	
  shapes	
  our	
  code
• Most	
  code	
  we	
  write	
  calls	
  an	
  API	
  
• Code	
  that	
 ...
!

http://docs.oracle.com/javaee/1.4/tutorial/examples/jaxp/xslt/samples/
TransformationApp04.java	
  

!

public	
  class...
What	
  makes	
  a	
  better	
  API
API	
  Quality:	
  Value
• Value	
  =	
  benefits	
  -­‐	
  costs	
  
• Benefits	
  
– Features	
  
– Data	
  
– ...	
  

...
API	
  Quality:	
  Usability
• API	
  Design	
  ==	
  Human	
  Interface	
  design	
  
– Although	
  API	
  is	
  for	
  m...
A	
  simple	
  model	
  for	
  API	
  Usability
Generic	
  usability	
  model	
  by	
  Ben	
  Shneiderman:
Learnability:	
...
API	
  Quality:	
  stability
Able	
  to	
  enhance/grow	
  implementation	
  without	
  
breaking	
  existing	
  consumer	...
API	
  Quality:	
  A	
  hierarchy	
  of	
  needs
Stability	
  only	
  matters	
  when	
  
API	
  is	
  valuable	
  and	
  ...
Building	
  Better	
  APIs
API	
  Design:	
  start	
  with	
  examples
• Examples	
  most	
  important	
  in	
  API	
  
documentation	
  
– Concrete	...
API	
  Design:	
  multiple	
  perspectives
Names,	
  Completeness,	
  
Grouping

UML:

public	
  class	
  Document	
  {	
 ...
API	
  practice:	
  Keep	
  it	
  simple
• Try	
  to	
  stick	
  to	
  just	
  methods	
  and	
  constructors	
  
– Factor...
API	
  practice:	
  avoid	
  verbose	
  constructs
• Constructs	
  that	
  create	
  verbose	
  consumer	
  code	
  
– Ext...
Example:	
  doing	
  some	
  loggin’
• Demo:	
  different	
  styles	
  of	
  logging	
  API
Why	
  Lambdas	
  are	
  so	
  much	
  better	
  than	
  inner	
  
classes
• Inner	
  classes,	
  or	
  extending	
  exist...
Example:	
  Lambda	
  benefits
• Demo:	
  Netbeans	
  example
API	
  practice:	
  fail	
  fast,	
  fail	
  hard
• Fail	
  immediately	
  on	
  wrong	
  input	
  
• Limit	
  the	
  use	...
API	
  Tool:	
  checking	
  for	
  null
• Tool:	
  FindBugs,	
  a	
  static	
  code	
  analyzer	
  
– Reports	
  errors	
 ...
FindBugs	
  demo	
  in	
  Eclipse
Finding	
  API	
  problems	
  in	
  your	
  code
• People	
  
– Team	
  knowledge	
  
– Policy,	
  “best	
  practices”,	
 ...
How	
  a	
  Dependency	
  Structure	
  Matrix	
  works
Classes/Packages

Document
Document

2

TextBlock

-­‐

Page

Page
...
Demo:	
  SonarQube	
  DSM
API	
  design	
  cheat	
  sheet
API	
  matters:	
  
Reuse	
  3rd	
  party	
  
Modular	
  design	
  
Distance	
  to	
  impl...
Upcoming SlideShare
Loading in …5
×

Example:  Lambda  benefits • Demo: Practices and tools for building better API (JFall 2013)

3,748 views

Published on

Example:
 Lambda
 benefits
• Demo:
 Netbeans
 example

Published in: Technology, Education
  • Sex in your area is here: ♥♥♥ http://bit.ly/2F7hN3u ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL eBOOK INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookeBOOK Crime, eeBOOK Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

×