SlideShare a Scribd company logo
1 of 129
Building APIs That Rock
                           Congratulations: If you’re here, you’re a nerd!




Wednesday, March 4, 2009
hi. i’m eaton.
                                                 •
               •                                     Voting API
                     eaton@lullabot.com

                                                 •
               •                                     Token
                     eaton in #drupal

                                                 •
               •                                     Form API
                     twitter.com/eaton

                                                 •   Render API

               •                                 •
                     @eaton is rambling in the       Amazon API
                     #drupalapi presentation.
                                                 •
                     no puppets yet!                 Twitter API



Wednesday, March 4, 2009
You Have Been
                            Deceived


Wednesday, March 4, 2009
You Have Been
                            Deceived


Wednesday, March 4, 2009
http://www.flickr.com/photos/diamondduste/1918745208/
Wednesday, March 4, 2009
Drupal, 2004




http://www.flickr.com/photos/diamondduste/1918745208/
Wednesday, March 4, 2009
http://www.flickr.com/photos/ejpphoto/2314610838/
Wednesday, March 4, 2009
Drupal, 2009
http://www.flickr.com/photos/ejpphoto/2314610838/
Wednesday, March 4, 2009
http://www.flickr.com/photos/jphilipson/582274247/
Wednesday, March 4, 2009
Your Module




http://www.flickr.com/photos/jphilipson/582274247/
Wednesday, March 4, 2009
What is an API?
                           (Hint: If it’s got comments, it’s fair game)




Wednesday, March 4, 2009
http://www.flickr.com/photos/noahwesley/120499365/
Wednesday, March 4, 2009
This is your code.


http://www.flickr.com/photos/noahwesley/120499365/
Wednesday, March 4, 2009
This is your code.
               Can other devs use it?
http://www.flickr.com/photos/noahwesley/120499365/
Wednesday, March 4, 2009
http://www.flickr.com/photos/splorp/126523012/
Wednesday, March 4, 2009
An
                                                  interface
                                                to reusable
                                                   features
http://www.flickr.com/photos/splorp/126523012/
Wednesday, March 4, 2009
An
                           Features! Ponies!
                                                  interface
                                                to reusable
                                                   features
http://www.flickr.com/photos/splorp/126523012/
Wednesday, March 4, 2009
Your API

                                                        An
                           Features! Ponies!
                                                  interface
                                                to reusable
                                                   features
http://www.flickr.com/photos/splorp/126523012/
Wednesday, March 4, 2009
Your UI


                             Your API

                                                        An
                           Features! Ponies!
                                                  interface
                                                to reusable
                                                   features
http://www.flickr.com/photos/splorp/126523012/
Wednesday, March 4, 2009
Your UI                     Code!


                             Your API

                                                                An
                           Features! Ponies!
                                                          interface
                                                        to reusable
                                                           features
http://www.flickr.com/photos/splorp/126523012/
Wednesday, March 4, 2009
Wednesday, March 4, 2009
An abstraction
                that hides
                complexity




Wednesday, March 4, 2009
http://www.flickr.com/photos/mikereys/2643220264/
Wednesday, March 4, 2009
An agreement
                                  about how things
                                          are done




http://www.flickr.com/photos/mikereys/2643220264/
Wednesday, March 4, 2009
Gentlemen! A Recap!




Wednesday, March 4, 2009
Gentlemen! A Recap!
                                • Drupal is complicated




Wednesday, March 4, 2009
Gentlemen! A Recap!
                                • Drupal is complicated
                                • APIs let other code
                                  use your features




Wednesday, March 4, 2009
Gentlemen! A Recap!
                                • Drupal is complicated
                                • APIs let other code
                                  use your features
                                • APIs hide complexity


Wednesday, March 4, 2009
Gentlemen! A Recap!
                                • Drupal is complicated
                                • APIs let other code
                                  use your features
                                • APIs hide complexity
                                • APIs get everyone on
                                  the same page


Wednesday, March 4, 2009
Screw this.




                           Let’s make an API.
http://www.flickr.com/photos/djou/2908514697/
Wednesday, March 4, 2009
When two modules love
                 each other very much
                           The real story of how one API came to be




Wednesday, March 4, 2009
Wednesday, March 4, 2009
VotingAPI 0.1
                “This module looks cool, but that one works better…”




Wednesday, March 4, 2009
Wednesday, March 4, 2009
Find the nouns!




Wednesday, March 4, 2009
Find the nouns!




Wednesday, March 4, 2009
Find the nouns!
                              They’re your data!




Wednesday, March 4, 2009
Find the nouns!
                              They’re your data!




                           Find the verbs!

Wednesday, March 4, 2009
Find the nouns!
                              They’re your data!




                           Find the verbs!

Wednesday, March 4, 2009
Find the nouns!
                               They’re your data!




                           Find the verbs!
                             They’re your functions!


Wednesday, March 4, 2009
Step 2: Evolution!
                           Are the verbs and nouns flexible enough?




Wednesday, March 4, 2009
Wednesday, March 4, 2009
Step 3: Planning Ahead
                           Letting other modules do the unanticipated




Wednesday, March 4, 2009
Wednesday, March 4, 2009
Wednesday, March 4, 2009
Wednesday, March 4, 2009
Wednesday, March 4, 2009
Wednesday, March 4, 2009
Wednesday, March 4, 2009
SCREW YOU,
       MISTER API
       DESIGNER GUY
http://www.flickr.com/photos/jayd/3296037643
Wednesday, March 4, 2009
http://www.flickr.com/photos/jayd/3296037643
Wednesday, March 4, 2009
What happens when someone adds a new type?




http://www.flickr.com/photos/jayd/3296037643
Wednesday, March 4, 2009
What happens when someone adds a new type?
                What happens when another person does?




http://www.flickr.com/photos/jayd/3296037643
Wednesday, March 4, 2009
What happens when someone adds a new type?
                What happens when another person does?

                       Use enums for lists that won’t change.




http://www.flickr.com/photos/jayd/3296037643
Wednesday, March 4, 2009
What happens when someone adds a new type?
                What happens when another person does?

                       Use enums for lists that won’t change.
                       Use strings for stuff you can’t predict


http://www.flickr.com/photos/jayd/3296037643
Wednesday, March 4, 2009
Boldly going where no
          module has gone before




Wednesday, March 4, 2009
Boldly going where no
          module has gone before




                           (planning ahead)
Wednesday, March 4, 2009
Remember the verbs?




Wednesday, March 4, 2009
Remember the verbs?
                           Are you doing things other modules care about?




Wednesday, March 4, 2009
Remember the verbs?
                           Are you doing things other modules care about?




Wednesday, March 4, 2009
Remember the verbs?
                           Are you doing things other modules care about?




Wednesday, March 4, 2009
Remember the verbs?
                           Are you doing things other modules care about?




                           module_invoke_all()
                                  It’s like party invitations for code

Wednesday, March 4, 2009
Remember the nouns?




Wednesday, March 4, 2009
Remember the nouns?
                  Are you building data other modules want to change?




Wednesday, March 4, 2009
Remember the nouns?
                  Are you building data other modules want to change?




Wednesday, March 4, 2009
Remember the nouns?
                  Are you building data other modules want to change?




Wednesday, March 4, 2009
Remember the nouns?
                  Are you building data other modules want to change?




                               drupal_alter()
                           It’s like passing around the doobie of data

Wednesday, March 4, 2009
Is your name Adrian?




Wednesday, March 4, 2009
Is your name Adrian?
                                  Perhaps Earl?




Wednesday, March 4, 2009
Is your name Adrian?
                                  Perhaps Earl?




Wednesday, March 4, 2009
Is your name Adrian?
                                  Perhaps Earl?




Wednesday, March 4, 2009
Is your name Adrian?
                                  Perhaps Earl?




Wednesday, March 4, 2009
Is your name Adrian?
                                  Perhaps Earl?




Wednesday, March 4, 2009
Is your name Adrian?
                                  Perhaps Earl?




Wednesday, March 4, 2009
Is your name Adrian?
                                              Perhaps Earl?




                Custom data structures
                           Build it, let modules alter it, then do stuff with it.


Wednesday, March 4, 2009
Stop! Hammertime!




Wednesday, March 4, 2009
Stop! Hammertime!
                                 • Identify verbs and nouns




Wednesday, March 4, 2009
Stop! Hammertime!
                                 • Identify verbs and nouns
                                 • Layer your verbs to hide
                                   complexity




Wednesday, March 4, 2009
Stop! Hammertime!
                                 • Identify verbs and nouns
                                 • Layer your verbs to hide
                                   complexity
                                 • Account for new uses



Wednesday, March 4, 2009
Stop! Hammertime!
                                 • Identify verbs and nouns
                                 • Layer your verbs to hide
                                   complexity
                                 • Account for new uses
                                 • Broadcast events via
                                   hooks



Wednesday, March 4, 2009
Stop! Hammertime!
                                 • Identify verbs and nouns
                                 • Layer your verbs to hide
                                   complexity
                                 • Account for new uses
                                 • Broadcast events via
                                   hooks
                                 • Let modules alter data
Wednesday, March 4, 2009
http://www.flickr.com/photos/tonyjcase/2847943252/
Wednesday, March 4, 2009
The Seven
                              Deadly
                                 Sins




                             http://www.flickr.com/photos/tonyjcase/2847943252/
Wednesday, March 4, 2009
The Lone Ranger




Wednesday, March 4, 2009
The Lone Ranger

                   • Reinventing the wheel




Wednesday, March 4, 2009
The Lone Ranger

                   • Reinventing the wheel
                   • Ignoring conventions



Wednesday, March 4, 2009
The Lone Ranger

                   • Reinventing the wheel
                   • Ignoring conventions
                   • Ignoring related APIs!


Wednesday, March 4, 2009
The Lone Ranger

                   • Reinventing the wheel
                   • Ignoring conventions
                   • Ignoring related APIs!
                   • Common for newcomers, or obsessives

Wednesday, March 4, 2009
Invisible Assumptions




Wednesday, March 4, 2009
Invisible Assumptions

                   • Assuming the global $user




Wednesday, March 4, 2009
Invisible Assumptions

                   • Assuming the global $user
                   • Checking arg(0)…



Wednesday, March 4, 2009
Invisible Assumptions

                   • Assuming the global $user
                   • Checking arg(0)…
                   • Assuming logged in users…


Wednesday, March 4, 2009
Invisible Assumptions

                   • Assuming the global $user
                   • Checking arg(0)…
                   • Assuming logged in users…
                   • Common with UI-bound APIs

Wednesday, March 4, 2009
Helping them to death




Wednesday, March 4, 2009
Helping them to death

                   • “I’ll set the breadcrumb while I’m at it...”




Wednesday, March 4, 2009
Helping them to death

                   • “I’ll set the breadcrumb while I’m at it...”
                   • “And I’ll send an email, too!”




Wednesday, March 4, 2009
Helping them to death

                   • “I’ll set the breadcrumb while I’m at it...”
                   • “And I’ll send an email, too!”
                   • “And add these links, and…”



Wednesday, March 4, 2009
Helping them to death

                   • “I’ll set the breadcrumb while I’m at it...”
                   • “And I’ll send an email, too!”
                   • “And add these links, and…”
                   • Common when an API grows out of a
                           specific use case, or an existing module



Wednesday, March 4, 2009
Leaky Abstraction




Wednesday, March 4, 2009
Leaky Abstraction

                   • “Just use this function…”




Wednesday, March 4, 2009
Leaky Abstraction

                   • “Just use this function…”
                   • ...And learn everything underneath it.




Wednesday, March 4, 2009
Leaky Abstraction

                   • “Just use this function…”
                   • ...And learn everything underneath it.
                   • Common in complex problem domains



Wednesday, March 4, 2009
Leaky Abstraction

                   • “Just use this function…”
                   • ...And learn everything underneath it.
                   • Common in complex problem domains
                   • Simplify, or get out of the way


Wednesday, March 4, 2009
Leaky Abstraction

                   • “Just use this function…”
                   • ...And learn everything underneath it.
                   • Common in complex problem domains
                   • Simplify, or get out of the way
                   • Sometimes, problems are just complicated.

Wednesday, March 4, 2009
Fake Flexibility




Wednesday, March 4, 2009
Fake Flexibility

                   • “Oh, you can save any data…” (votingapi)




Wednesday, March 4, 2009
Fake Flexibility

                   • “Oh, you can save any data…” (votingapi)
                   • “Oh, there’s a hook for that…” (blogapi)



Wednesday, March 4, 2009
Fake Flexibility

                   • “Oh, you can save any data…” (votingapi)
                   • “Oh, there’s a hook for that…” (blogapi)
                   • Build 3 test implementations


Wednesday, March 4, 2009
Fake Flexibility

                   • “Oh, you can save any data…” (votingapi)
                   • “Oh, there’s a hook for that…” (blogapi)
                   • Build 3 test implementations
                   • Step through different use cases

Wednesday, March 4, 2009
Mission Creep




Wednesday, March 4, 2009
Mission Creep

                   • Even worse than feature creep




Wednesday, March 4, 2009
Mission Creep

                   • Even worse than feature creep
                   • Common with “solve-a-big-problem” APIs



Wednesday, March 4, 2009
Mission Creep

                   • Even worse than feature creep
                   • Common with “solve-a-big-problem” APIs
                   • Focus, focus, focus.


Wednesday, March 4, 2009
Mission Creep

                   • Even worse than feature creep
                   • Common with “solve-a-big-problem” APIs
                   • Focus, focus, focus.
                   • Split into complementary APIs

Wednesday, March 4, 2009
Dependency Soup




Wednesday, March 4, 2009
Dependency Soup

                   • The flip side of mission creep




Wednesday, March 4, 2009
Dependency Soup

                   • The flip side of mission creep
                   • Focus, focus, focus!



Wednesday, March 4, 2009
Dependency Soup

                   • The flip side of mission creep
                   • Focus, focus, focus!
                   • Make the dependencies optional


Wednesday, March 4, 2009
Dependency Soup

                   • The flip side of mission creep
                   • Focus, focus, focus!
                   • Make the dependencies optional
                   • Pray for a package manager

Wednesday, March 4, 2009
Oh, the Recappery!




Wednesday, March 4, 2009
Oh, the Recappery!

                                   • Cooperate




Wednesday, March 4, 2009
Oh, the Recappery!

                                   • Cooperate
                                   • Don’t assume too much




Wednesday, March 4, 2009
Oh, the Recappery!

                                   • Cooperate
                                   • Don’t assume too much
                                   • Don’t be pushy



Wednesday, March 4, 2009
Oh, the Recappery!

                                   • Cooperate
                                   • Don’t assume too much
                                   • Don’t be pushy
                                   • Simplify or step aside


Wednesday, March 4, 2009
Oh, the Recappery!

                                   • Cooperate
                                   • Don’t assume too much
                                   • Don’t be pushy
                                   • Simplify or step aside
                                   • Test your extensions

Wednesday, March 4, 2009
Oh, the Recappery!

                                   • Cooperate
                                   • Don’t assume too much
                                   • Don’t be pushy
                                   • Simplify or step aside
                                   • Test your extensions
                                   • Stay focused
Wednesday, March 4, 2009
http://www.flickr.com/photos/-sel-/60124578/
Wednesday, March 4, 2009
What? That’s it?
 http://www.flickr.com/photos/-sel-/60124578/
Wednesday, March 4, 2009
Thanks, flickr!

      •                                             •
            http://www.flickr.com/photos/mikereys        http://www.flickr.com/photos/jayd

      •                                             •
            http://www.flickr.com/photos/splorp          http://www.flickr.com/photos/djou

      •                                             •
            http://www.flickr.com/photos/                http://www.flickr.com/photos/-sel-
            noahwesley
                                                    •   http://www.flickr.com/photos/
      •     http://www.flickr.com/photos/tonyjcase       diamondduste

      •                                             •
            http://www.flickr.com/photos/ejpphoto        http://www.flickr.com/photos/jphilipson




Wednesday, March 4, 2009

More Related Content

Similar to Building Apis That Rock

Mwsf09 Session Ultimate Mac Starter Class
Mwsf09 Session   Ultimate Mac Starter ClassMwsf09 Session   Ultimate Mac Starter Class
Mwsf09 Session Ultimate Mac Starter ClassChuck La Tournous
 
Updated: Barcamp Kl 0409 Hacker Space Kl 2
Updated: Barcamp Kl 0409 Hacker Space  Kl 2Updated: Barcamp Kl 0409 Hacker Space  Kl 2
Updated: Barcamp Kl 0409 Hacker Space Kl 2barcamp.my
 
Personal branding, social media and pretty pictures
Personal branding, social media and pretty picturesPersonal branding, social media and pretty pictures
Personal branding, social media and pretty picturesJure Cuhalev
 
Firefox 3.5 and Beyond, At Portland Web Innovators
Firefox 3.5 and Beyond, At Portland Web InnovatorsFirefox 3.5 and Beyond, At Portland Web Innovators
Firefox 3.5 and Beyond, At Portland Web InnovatorsDietrich Ayala
 
OpenID DrupalCon 2009
OpenID DrupalCon 2009OpenID DrupalCon 2009
OpenID DrupalCon 2009James Walker
 
The Twitter API: A Presentation to Adobe
The Twitter API: A Presentation to AdobeThe Twitter API: A Presentation to Adobe
The Twitter API: A Presentation to AdobeAlex Payne
 
DrupalCon DC: Busines Analytics with Views
DrupalCon DC: Busines Analytics with ViewsDrupalCon DC: Busines Analytics with Views
DrupalCon DC: Busines Analytics with ViewsIrakli Nadareishvili
 
1: CoffeeBuzz (Katie Lips)
1: CoffeeBuzz (Katie Lips)1: CoffeeBuzz (Katie Lips)
1: CoffeeBuzz (Katie Lips)Imran Ali
 
Libraries + Semantic Web = ?
Libraries + Semantic Web = ?Libraries + Semantic Web = ?
Libraries + Semantic Web = ?Richard Wallis
 
Props to Prototypes: Design Fiction Part 2 Design Connexity 2009
Props to Prototypes: Design Fiction Part 2 Design Connexity 2009Props to Prototypes: Design Fiction Part 2 Design Connexity 2009
Props to Prototypes: Design Fiction Part 2 Design Connexity 2009Julian Bleecker
 
Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?Bart De Waele
 
Managing And Optimizing Memory Usage
Managing And Optimizing Memory UsageManaging And Optimizing Memory Usage
Managing And Optimizing Memory UsageJohn Wilker
 
Encontro de TI - Arteccom
Encontro de TI - ArteccomEncontro de TI - Arteccom
Encontro de TI - ArteccomFabio Akita
 
In context
In contextIn context
In contextg1sh
 
JRuby on Rails
JRuby on RailsJRuby on Rails
JRuby on RailsFabio Kung
 

Similar to Building Apis That Rock (20)

Mwsf09 Session Ultimate Mac Starter Class
Mwsf09 Session   Ultimate Mac Starter ClassMwsf09 Session   Ultimate Mac Starter Class
Mwsf09 Session Ultimate Mac Starter Class
 
Updated: Barcamp Kl 0409 Hacker Space Kl 2
Updated: Barcamp Kl 0409 Hacker Space  Kl 2Updated: Barcamp Kl 0409 Hacker Space  Kl 2
Updated: Barcamp Kl 0409 Hacker Space Kl 2
 
Why I Hate Drupal
Why I Hate DrupalWhy I Hate Drupal
Why I Hate Drupal
 
Depot Best Practices
Depot Best PracticesDepot Best Practices
Depot Best Practices
 
Personal branding, social media and pretty pictures
Personal branding, social media and pretty picturesPersonal branding, social media and pretty pictures
Personal branding, social media and pretty pictures
 
Firefox 3.5 and Beyond, At Portland Web Innovators
Firefox 3.5 and Beyond, At Portland Web InnovatorsFirefox 3.5 and Beyond, At Portland Web Innovators
Firefox 3.5 and Beyond, At Portland Web Innovators
 
OpenID DrupalCon 2009
OpenID DrupalCon 2009OpenID DrupalCon 2009
OpenID DrupalCon 2009
 
The Twitter API: A Presentation to Adobe
The Twitter API: A Presentation to AdobeThe Twitter API: A Presentation to Adobe
The Twitter API: A Presentation to Adobe
 
DrupalCon DC: Busines Analytics with Views
DrupalCon DC: Busines Analytics with ViewsDrupalCon DC: Busines Analytics with Views
DrupalCon DC: Busines Analytics with Views
 
Social Software at work
Social Software at workSocial Software at work
Social Software at work
 
1: CoffeeBuzz (Katie Lips)
1: CoffeeBuzz (Katie Lips)1: CoffeeBuzz (Katie Lips)
1: CoffeeBuzz (Katie Lips)
 
Libraries + Semantic Web = ?
Libraries + Semantic Web = ?Libraries + Semantic Web = ?
Libraries + Semantic Web = ?
 
Adhearsion @ eComm 2009 Final
Adhearsion @ eComm 2009   FinalAdhearsion @ eComm 2009   Final
Adhearsion @ eComm 2009 Final
 
Props to Prototypes: Design Fiction Part 2 Design Connexity 2009
Props to Prototypes: Design Fiction Part 2 Design Connexity 2009Props to Prototypes: Design Fiction Part 2 Design Connexity 2009
Props to Prototypes: Design Fiction Part 2 Design Connexity 2009
 
Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?
 
Twitter on Rails
Twitter on RailsTwitter on Rails
Twitter on Rails
 
Managing And Optimizing Memory Usage
Managing And Optimizing Memory UsageManaging And Optimizing Memory Usage
Managing And Optimizing Memory Usage
 
Encontro de TI - Arteccom
Encontro de TI - ArteccomEncontro de TI - Arteccom
Encontro de TI - Arteccom
 
In context
In contextIn context
In context
 
JRuby on Rails
JRuby on RailsJRuby on Rails
JRuby on Rails
 

More from Jeff Eaton

This Is not a Place of Honor
This Is not a Place of HonorThis Is not a Place of Honor
This Is not a Place of HonorJeff Eaton
 
An API Won't Fix Your Content Problem
An API Won't Fix Your Content ProblemAn API Won't Fix Your Content Problem
An API Won't Fix Your Content ProblemJeff Eaton
 
Hello, {{FIRSTNAME}}, My Old Friend
Hello, {{FIRSTNAME}}, My Old FriendHello, {{FIRSTNAME}}, My Old Friend
Hello, {{FIRSTNAME}}, My Old FriendJeff Eaton
 
Maps, Models, and Teams
Maps, Models, and TeamsMaps, Models, and Teams
Maps, Models, and TeamsJeff Eaton
 
Collaborative Content Modeling
Collaborative Content ModelingCollaborative Content Modeling
Collaborative Content ModelingJeff Eaton
 
Adventures in Drupal 8
Adventures in Drupal 8Adventures in Drupal 8
Adventures in Drupal 8Jeff Eaton
 
Modeling Rich Narrative Content
Modeling Rich Narrative ContentModeling Rich Narrative Content
Modeling Rich Narrative ContentJeff Eaton
 
Battle for the Body Field (DrupalCon)
Battle for the Body Field (DrupalCon)Battle for the Body Field (DrupalCon)
Battle for the Body Field (DrupalCon)Jeff Eaton
 
The Battle For The Body Field
The Battle For The Body FieldThe Battle For The Body Field
The Battle For The Body FieldJeff Eaton
 
Workflow That Works Under Pressure
Workflow That Works Under PressureWorkflow That Works Under Pressure
Workflow That Works Under PressureJeff Eaton
 
Planning Beyond the Page
Planning Beyond the PagePlanning Beyond the Page
Planning Beyond the PageJeff Eaton
 
Building Your Agency's Content Strategy Practice
Building Your Agency's Content Strategy PracticeBuilding Your Agency's Content Strategy Practice
Building Your Agency's Content Strategy PracticeJeff Eaton
 
Deblobbing In The Real World
Deblobbing In The Real WorldDeblobbing In The Real World
Deblobbing In The Real WorldJeff Eaton
 
Prepare for the Mobilacalypse
Prepare for the MobilacalypsePrepare for the Mobilacalypse
Prepare for the MobilacalypseJeff Eaton
 
Drupal in Action (CMS Expo 2011)
Drupal in Action (CMS Expo 2011)Drupal in Action (CMS Expo 2011)
Drupal in Action (CMS Expo 2011)Jeff Eaton
 
Baby Got Backend (CMS Expo 2011)
Baby Got Backend (CMS Expo 2011)Baby Got Backend (CMS Expo 2011)
Baby Got Backend (CMS Expo 2011)Jeff Eaton
 
The Platypus Problem
The Platypus ProblemThe Platypus Problem
The Platypus ProblemJeff Eaton
 
Drupal in Action
Drupal in ActionDrupal in Action
Drupal in ActionJeff Eaton
 
Architecture Is For Everyone
Architecture Is For EveryoneArchitecture Is For Everyone
Architecture Is For EveryoneJeff Eaton
 

More from Jeff Eaton (20)

This Is not a Place of Honor
This Is not a Place of HonorThis Is not a Place of Honor
This Is not a Place of Honor
 
An API Won't Fix Your Content Problem
An API Won't Fix Your Content ProblemAn API Won't Fix Your Content Problem
An API Won't Fix Your Content Problem
 
Hello, {{FIRSTNAME}}, My Old Friend
Hello, {{FIRSTNAME}}, My Old FriendHello, {{FIRSTNAME}}, My Old Friend
Hello, {{FIRSTNAME}}, My Old Friend
 
Maps, Models, and Teams
Maps, Models, and TeamsMaps, Models, and Teams
Maps, Models, and Teams
 
Collaborative Content Modeling
Collaborative Content ModelingCollaborative Content Modeling
Collaborative Content Modeling
 
Adventures in Drupal 8
Adventures in Drupal 8Adventures in Drupal 8
Adventures in Drupal 8
 
Recoupling
RecouplingRecoupling
Recoupling
 
Modeling Rich Narrative Content
Modeling Rich Narrative ContentModeling Rich Narrative Content
Modeling Rich Narrative Content
 
Battle for the Body Field (DrupalCon)
Battle for the Body Field (DrupalCon)Battle for the Body Field (DrupalCon)
Battle for the Body Field (DrupalCon)
 
The Battle For The Body Field
The Battle For The Body FieldThe Battle For The Body Field
The Battle For The Body Field
 
Workflow That Works Under Pressure
Workflow That Works Under PressureWorkflow That Works Under Pressure
Workflow That Works Under Pressure
 
Planning Beyond the Page
Planning Beyond the PagePlanning Beyond the Page
Planning Beyond the Page
 
Building Your Agency's Content Strategy Practice
Building Your Agency's Content Strategy PracticeBuilding Your Agency's Content Strategy Practice
Building Your Agency's Content Strategy Practice
 
Deblobbing In The Real World
Deblobbing In The Real WorldDeblobbing In The Real World
Deblobbing In The Real World
 
Prepare for the Mobilacalypse
Prepare for the MobilacalypsePrepare for the Mobilacalypse
Prepare for the Mobilacalypse
 
Drupal in Action (CMS Expo 2011)
Drupal in Action (CMS Expo 2011)Drupal in Action (CMS Expo 2011)
Drupal in Action (CMS Expo 2011)
 
Baby Got Backend (CMS Expo 2011)
Baby Got Backend (CMS Expo 2011)Baby Got Backend (CMS Expo 2011)
Baby Got Backend (CMS Expo 2011)
 
The Platypus Problem
The Platypus ProblemThe Platypus Problem
The Platypus Problem
 
Drupal in Action
Drupal in ActionDrupal in Action
Drupal in Action
 
Architecture Is For Everyone
Architecture Is For EveryoneArchitecture Is For Everyone
Architecture Is For Everyone
 

Recently uploaded

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 

Building Apis That Rock

Editor's Notes

  1. You were promised puppets. Also, magic. Unfortunately, you’ve been deceived. There are no puppets. The ends justify the means: APIs are Drupal’s lifeblood.
  2. When I started using Drupal, it was a little goofy, but fundamentally simple. Core. Some modules (gallery? event? done!) Maybe a custom module and a theme if you were REALLY crazy.
  3. When I started using Drupal, it was a little goofy, but fundamentally simple. Core. Some modules (gallery? event? done!) Maybe a custom module and a theme if you were REALLY crazy.
  4. Today, lots and lots of smaller modules Image == Views, CCK, FileField, ImageField, ImageCache, ImageAPI, Custom Breadcrumbs. Flexibility vs. Complexity All the pieces have to work with each other! And that’s where APIs come in.
  5. Today, lots and lots of smaller modules Image == Views, CCK, FileField, ImageField, ImageCache, ImageAPI, Custom Breadcrumbs. Flexibility vs. Complexity All the pieces have to work with each other! And that’s where APIs come in.
  6. The pull between functionality and flexibility Building code that does stuff, APIs that let other code control it, and UIs that let users configure/control
  7. The pull between functionality and flexibility Building code that does stuff, APIs that let other code control it, and UIs that let users configure/control
  8. Imagine a Drupal module as a giant pile of money. Mmmmmmmmmmm. Each of those awesome features is like a crisp $20. Imagine “Code” -- other Drupal modules -- as users who can’t click on anything. All they can do is call other functions. Can they use your module? Could an install profile set up your module automatically? Can someone turn off your UI entirely, and make it automatic? Can someone build a new UI for your module?
  9. Imagine a Drupal module as a giant pile of money. Mmmmmmmmmmm. Each of those awesome features is like a crisp $20. Imagine “Code” -- other Drupal modules -- as users who can’t click on anything. All they can do is call other functions. Can they use your module? Could an install profile set up your module automatically? Can someone turn off your UI entirely, and make it automatic? Can someone build a new UI for your module?
  10. Imagine a Drupal module as a giant pile of money. Mmmmmmmmmmm. Each of those awesome features is like a crisp $20. Imagine “Code” -- other Drupal modules -- as users who can’t click on anything. All they can do is call other functions. Can they use your module? Could an install profile set up your module automatically? Can someone turn off your UI entirely, and make it automatic? Can someone build a new UI for your module?
  11. The ATM is a metaphor: it’s a basic way of controlling things that can be used externally. Flag Organic Groups node_save()
  12. The ATM is a metaphor: it’s a basic way of controlling things that can be used externally. Flag Organic Groups node_save()
  13. The ATM is a metaphor: it’s a basic way of controlling things that can be used externally. Flag Organic Groups node_save()
  14. The ATM is a metaphor: it’s a basic way of controlling things that can be used externally. Flag Organic Groups node_save()
  15. The ATM is a metaphor: it’s a basic way of controlling things that can be used externally. Flag Organic Groups node_save()
  16. The ATM is a metaphor: it’s a basic way of controlling things that can be used externally. Flag Organic Groups node_save()
  17. Something complicated can be simplified by putting a buffer between it, and you. ImageAPI Messaging Visitor cache_get() and cache_set()
  18. Something complicated can be simplified by putting a buffer between it, and you. ImageAPI Messaging Visitor cache_get() and cache_set()
  19. The value in credit cards isn’t that they’re thin and plastic It’s that everyone uses them, so the problem of “IOUs” and “Store credit” and “Pay you back later” are all handled with this. Everyone’s on the same page, so they can get on to solving other problems
  20. The value in credit cards isn’t that they’re thin and plastic It’s that everyone uses them, so the problem of “IOUs” and “Store credit” and “Pay you back later” are all handled with this. Everyone’s on the same page, so they can get on to solving other problems
  21. History of VotingAPI - 2005 Was making a community site that needed to rate comments AND nodes, with a nice flash widget AND a nice Picked the one that seemed best and shamelessly ripped its guts out
  22. History of VotingAPI - 2005 Was making a community site that needed to rate comments AND nodes, with a nice flash widget AND a nice Picked the one that seemed best and shamelessly ripped its guts out
  23. History of VotingAPI - 2005 Was making a community site that needed to rate comments AND nodes, with a nice flash widget AND a nice Picked the one that seemed best and shamelessly ripped its guts out
  24. Voila! VotingAPI 1.0 Beta! Simple, but effective. How to start thinking about it like an API? Find the nouns Find the verbs This is similar to building good classes in OOP languages like Java. Those guys think about APIs all freakin’ day.
  25. Voila! VotingAPI 1.0 Beta! Simple, but effective. How to start thinking about it like an API? Find the nouns Find the verbs This is similar to building good classes in OOP languages like Java. Those guys think about APIs all freakin’ day.
  26. Voila! VotingAPI 1.0 Beta! Simple, but effective. How to start thinking about it like an API? Find the nouns Find the verbs This is similar to building good classes in OOP languages like Java. Those guys think about APIs all freakin’ day.
  27. Voila! VotingAPI 1.0 Beta! Simple, but effective. How to start thinking about it like an API? Find the nouns Find the verbs This is similar to building good classes in OOP languages like Java. Those guys think about APIs all freakin’ day.
  28. Voila! VotingAPI 1.0 Beta! Simple, but effective. How to start thinking about it like an API? Find the nouns Find the verbs This is similar to building good classes in OOP languages like Java. Those guys think about APIs all freakin’ day.
  29. Voila! VotingAPI 1.0 Beta! Simple, but effective. How to start thinking about it like an API? Find the nouns Find the verbs This is similar to building good classes in OOP languages like Java. Those guys think about APIs all freakin’ day.
  30. Discussions on drupal.org, working with other developers to gather use cases. Not flexible enough! My my noun weren’t precise enough… Additional data: “Tag” for multiple criteria voting My verbs were too broad! Sub-functions. Building in layers is important
  31. Discussions on drupal.org, working with other developers to gather use cases. Not flexible enough! My my noun weren’t precise enough… Additional data: “Tag” for multiple criteria voting My verbs were too broad! Sub-functions. Building in layers is important
  32. Discussions on drupal.org, working with other developers to gather use cases. Not flexible enough! My my noun weren’t precise enough… Additional data: “Tag” for multiple criteria voting My verbs were too broad! Sub-functions. Building in layers is important
  33. Discussions on drupal.org, working with other developers to gather use cases. Not flexible enough! My my noun weren’t precise enough… Additional data: “Tag” for multiple criteria voting My verbs were too broad! Sub-functions. Building in layers is important
  34. Feedback: Vote on a 1-100 scale! Or vote with “points” like Digg! And getting results is too slow -- sorting and filtering with them takes complex SQL! The “vote” noun has a ‘value type’ now. What does the number MEAN? New noun: “Results”, new verb “Recalculate” Now have votes that can be set, and retrieved. Results that can be recalculated and retrieved. “Value type” lets modules use it in unanticipated ways, too!
  35. Feedback: Vote on a 1-100 scale! Or vote with “points” like Digg! And getting results is too slow -- sorting and filtering with them takes complex SQL! The “vote” noun has a ‘value type’ now. What does the number MEAN? New noun: “Results”, new verb “Recalculate” Now have votes that can be set, and retrieved. Results that can be recalculated and retrieved. “Value type” lets modules use it in unanticipated ways, too!
  36. Feedback: Vote on a 1-100 scale! Or vote with “points” like Digg! And getting results is too slow -- sorting and filtering with them takes complex SQL! The “vote” noun has a ‘value type’ now. What does the number MEAN? New noun: “Results”, new verb “Recalculate” Now have votes that can be set, and retrieved. Results that can be recalculated and retrieved. “Value type” lets modules use it in unanticipated ways, too!
  37. Feedback: Vote on a 1-100 scale! Or vote with “points” like Digg! And getting results is too slow -- sorting and filtering with them takes complex SQL! The “vote” noun has a ‘value type’ now. What does the number MEAN? New noun: “Results”, new verb “Recalculate” Now have votes that can be set, and retrieved. Results that can be recalculated and retrieved. “Value type” lets modules use it in unanticipated ways, too!
  38. Feedback: Vote on a 1-100 scale! Or vote with “points” like Digg! And getting results is too slow -- sorting and filtering with them takes complex SQL! The “vote” noun has a ‘value type’ now. What does the number MEAN? New noun: “Results”, new verb “Recalculate” Now have votes that can be set, and retrieved. Results that can be recalculated and retrieved. “Value type” lets modules use it in unanticipated ways, too!
  39. Feedback: Vote on a 1-100 scale! Or vote with “points” like Digg! And getting results is too slow -- sorting and filtering with them takes complex SQL! The “vote” noun has a ‘value type’ now. What does the number MEAN? New noun: “Results”, new verb “Recalculate” Now have votes that can be set, and retrieved. Results that can be recalculated and retrieved. “Value type” lets modules use it in unanticipated ways, too!
  40. Feedback: Vote on a 1-100 scale! Or vote with “points” like Digg! And getting results is too slow -- sorting and filtering with them takes complex SQL! The “vote” noun has a ‘value type’ now. What does the number MEAN? New noun: “Results”, new verb “Recalculate” Now have votes that can be set, and retrieved. Results that can be recalculated and retrieved. “Value type” lets modules use it in unanticipated ways, too!
  41. Feedback: Vote on a 1-100 scale! Or vote with “points” like Digg! And getting results is too slow -- sorting and filtering with them takes complex SQL! The “vote” noun has a ‘value type’ now. What does the number MEAN? New noun: “Results”, new verb “Recalculate” Now have votes that can be set, and retrieved. Results that can be recalculated and retrieved. “Value type” lets modules use it in unanticipated ways, too!
  42. Feedback: Vote on a 1-100 scale! Or vote with “points” like Digg! And getting results is too slow -- sorting and filtering with them takes complex SQL! The “vote” noun has a ‘value type’ now. What does the number MEAN? New noun: “Results”, new verb “Recalculate” Now have votes that can be set, and retrieved. Results that can be recalculated and retrieved. “Value type” lets modules use it in unanticipated ways, too!
  43. Feedback: Vote on a 1-100 scale! Or vote with “points” like Digg! And getting results is too slow -- sorting and filtering with them takes complex SQL! The “vote” noun has a ‘value type’ now. What does the number MEAN? New noun: “Results”, new verb “Recalculate” Now have votes that can be set, and retrieved. Results that can be recalculated and retrieved. “Value type” lets modules use it in unanticipated ways, too!
  44. Feedback: Vote on a 1-100 scale! Or vote with “points” like Digg! And getting results is too slow -- sorting and filtering with them takes complex SQL! The “vote” noun has a ‘value type’ now. What does the number MEAN? New noun: “Results”, new verb “Recalculate” Now have votes that can be set, and retrieved. Results that can be recalculated and retrieved. “Value type” lets modules use it in unanticipated ways, too!
  45. Holy crap, someone hates me. Quick show of hands -- what’s wrong with this?
  46. Holy crap, someone hates me. Quick show of hands -- what’s wrong with this?
  47. Holy crap, someone hates me. Quick show of hands -- what’s wrong with this?
  48. Holy crap, someone hates me. Quick show of hands -- what’s wrong with this?
  49. Holy crap, someone hates me. Quick show of hands -- what’s wrong with this?
  50. Holy crap, someone hates me. Quick show of hands -- what’s wrong with this?
  51. We’ve covered the basics of letting other modules “steer” your code. The next step - giving your module points of expansion Several common patterns in Drupal