SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Building API’s A.K.A. making your module extensible
Who Am I? Adam A. Gregory Drupal Developer, Themer, Consultant, and Trainer Using Drupal For 5+ years Built and maintain  numerous modules/themes on Drupal.org Been involved in Drupal projects large and small Recently released my first API module, Piecemaker API, & currently converting the Theme Editor module to more of an API in D7
What We’ll Cover What is an API How it applies to building modules How do I code an API module? Planning Proper structures (hooks, classes) Drupal Coding Standards Code, Test, Code, Test Give Examples (example.api.php) Release into the wild Real World Examples
What is an API? Application Programming Interface Allows other code/programs/modules/etc. to reutilize it’s utilities, resources, and/or services Provides a more efficient code base in Drupal (ussually) Drupal is essentially a big API, or rather a group of API’s
How do I code an API module? Code, Pray, Test,  Yell, Throw computer in pool, Give up, Become a monk.
Planning A good plan violently executed now is better than a perfect plan executed next week. 		- General George S. Patton Use a whiteboard, mindmap, pad of paper Think through possible uses, by both devs and end users Steal ideas! (It’s OK, that’s what Open Source is for)
Proper Structures Classes Drupal is moving slowly but surely to a more OOP approach so try to plan for that. In D7 there is auto loading of Classes so it makes for more efficient code. In order to utilize classes you must initialize classes dynamically, not statically. (May also apply to methods depending on your module use) Classes can easily be extended so they are preferable.
Proper Structures Hooks You can write an entire API that only utilizes hooks. Hooks will be needed even in API that are mostly OOP. The entire Drupal system was built as a hooker so it  is easily understood by most developers
Drupal Coding Standards In order for your module to be extensible it MUST, MUST, MUST conform to Drupal coding standards and practices. Common mistakes Not using a theme() function for ANY html output Not using drupal_alter() to allow other modules access Not Documenting properly: PHPDoc, example.api.php
Code, Test, Code, Test
Give Examples Document you code thoroughly Use your own hooks if possible Provide an example.api.php that shows some implementations of your hooks and classes Code the first module that implements the API and include it.
Release it into the wild! You’ve done it right? Not so fast my friend… No you have to support it. Provide documentation on Drupal.org Answer Issues Fix bugs Provide Support Make improvements Make new releases Lather, Rinse, Repeat
Lets Look At Some Code Views, Fields, Piecemaker
Q&A You ask. I answer. Lets keep it simple… Not the questions, just the subtitle.
Adam A. Gregory Web: Causecast.org NewhallWeb.com Twitter: @adamgregory Email: arcaneadam@gmail.com Adam@NewhallWeb.com Drupal: arcaneadam

Weitere ähnliche Inhalte

Was ist angesagt?

Building better WordPress applications
Building better WordPress applicationsBuilding better WordPress applications
Building better WordPress applicationsPhill Brown
 
Opensources benefits
Opensources benefitsOpensources benefits
Opensources benefitsBeehexa
 
Opensources benefits withlogo phanvugiap_gurutheme.com
Opensources benefits withlogo phanvugiap_gurutheme.comOpensources benefits withlogo phanvugiap_gurutheme.com
Opensources benefits withlogo phanvugiap_gurutheme.comBeehexa
 
Java and effective programming. Is it possible? - IAESTE Case Week 2016
Java and effective programming. Is it possible? - IAESTE Case Week 2016Java and effective programming. Is it possible? - IAESTE Case Week 2016
Java and effective programming. Is it possible? - IAESTE Case Week 2016Łukasz Koniecki
 
Effective programming in Java - Kronospan Job Fair 2016
Effective programming in Java - Kronospan Job Fair 2016Effective programming in Java - Kronospan Job Fair 2016
Effective programming in Java - Kronospan Job Fair 2016Łukasz Koniecki
 
Functional Programming Concept
Functional Programming ConceptFunctional Programming Concept
Functional Programming Conceptailhanli
 
Static site best practices
Static site best practicesStatic site best practices
Static site best practicesAllanki Srinivas
 
Not All Heroes Wear Capes: Skills and Tools Helpful in Becoming a Support Sup...
Not All Heroes Wear Capes: Skills and Tools Helpful in Becoming a Support Sup...Not All Heroes Wear Capes: Skills and Tools Helpful in Becoming a Support Sup...
Not All Heroes Wear Capes: Skills and Tools Helpful in Becoming a Support Sup...Atlassian
 
Appex technologies
Appex technologiesAppex technologies
Appex technologiesNIVETHAS52
 

Was ist angesagt? (10)

Building better WordPress applications
Building better WordPress applicationsBuilding better WordPress applications
Building better WordPress applications
 
Opensources benefits
Opensources benefitsOpensources benefits
Opensources benefits
 
Opensources benefits withlogo phanvugiap_gurutheme.com
Opensources benefits withlogo phanvugiap_gurutheme.comOpensources benefits withlogo phanvugiap_gurutheme.com
Opensources benefits withlogo phanvugiap_gurutheme.com
 
Java and effective programming. Is it possible? - IAESTE Case Week 2016
Java and effective programming. Is it possible? - IAESTE Case Week 2016Java and effective programming. Is it possible? - IAESTE Case Week 2016
Java and effective programming. Is it possible? - IAESTE Case Week 2016
 
Effective programming in Java - Kronospan Job Fair 2016
Effective programming in Java - Kronospan Job Fair 2016Effective programming in Java - Kronospan Job Fair 2016
Effective programming in Java - Kronospan Job Fair 2016
 
Functional Programming Concept
Functional Programming ConceptFunctional Programming Concept
Functional Programming Concept
 
Static site best practices
Static site best practicesStatic site best practices
Static site best practices
 
Not All Heroes Wear Capes: Skills and Tools Helpful in Becoming a Support Sup...
Not All Heroes Wear Capes: Skills and Tools Helpful in Becoming a Support Sup...Not All Heroes Wear Capes: Skills and Tools Helpful in Becoming a Support Sup...
Not All Heroes Wear Capes: Skills and Tools Helpful in Becoming a Support Sup...
 
Selenium and Cucumber Automation Services
Selenium and Cucumber Automation ServicesSelenium and Cucumber Automation Services
Selenium and Cucumber Automation Services
 
Appex technologies
Appex technologiesAppex technologies
Appex technologies
 

Andere mochten auch

Flexible site building with Fields and Views
Flexible site building with Fields and ViewsFlexible site building with Fields and Views
Flexible site building with Fields and Viewsarcaneadam
 
Advanced Theming
Advanced ThemingAdvanced Theming
Advanced Themingarcaneadam
 
Creating an API with Expressive
Creating an API with ExpressiveCreating an API with Expressive
Creating an API with ExpressiveElton Minetto
 
A Random Walk Down Wall Street
A Random Walk Down Wall StreetA Random Walk Down Wall Street
A Random Walk Down Wall Streetarcaneadam
 
Testing Plan Test Case
Testing Plan Test CaseTesting Plan Test Case
Testing Plan Test Caseguest4c6fd6
 

Andere mochten auch (7)

Flexible site building with Fields and Views
Flexible site building with Fields and ViewsFlexible site building with Fields and Views
Flexible site building with Fields and Views
 
Advanced Theming
Advanced ThemingAdvanced Theming
Advanced Theming
 
Creating an API with Expressive
Creating an API with ExpressiveCreating an API with Expressive
Creating an API with Expressive
 
A Random Walk Down Wall Street
A Random Walk Down Wall StreetA Random Walk Down Wall Street
A Random Walk Down Wall Street
 
Test api
Test apiTest api
Test api
 
Testing Plan Test Case
Testing Plan Test CaseTesting Plan Test Case
Testing Plan Test Case
 
Amazon search test case document
Amazon search test case documentAmazon search test case document
Amazon search test case document
 

Ähnlich wie Building API's

Contributing to Drupal
Contributing to DrupalContributing to Drupal
Contributing to DrupalChris Skene
 
Domas monkus drupal module development
Domas monkus drupal module developmentDomas monkus drupal module development
Domas monkus drupal module developmentDomas Monkus
 
Adapter design-pattern2015
Adapter design-pattern2015Adapter design-pattern2015
Adapter design-pattern2015Vic Tarchenko
 
Intro to drupal
Intro to drupalIntro to drupal
Intro to drupalarcaneadam
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure rupeshchanchal
 
Drupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsDrupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsphp2ranjan
 
Creating Drupal A Module
Creating Drupal A ModuleCreating Drupal A Module
Creating Drupal A Modulearcaneadam
 
Bending the odoo learning curve - Odoo Experience 2015
Bending the odoo learning curve - Odoo Experience 2015Bending the odoo learning curve - Odoo Experience 2015
Bending the odoo learning curve - Odoo Experience 2015Daniel Reis
 
Making The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowMaking The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowPhilip Norton
 
Recipe of a rockstar developer
Recipe of a rockstar developerRecipe of a rockstar developer
Recipe of a rockstar developerTopu Newaj
 
Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7Ryan Szrama
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Mack Hardy
 
MVC Frameworks for building PHP Web Applications
MVC Frameworks for building PHP Web ApplicationsMVC Frameworks for building PHP Web Applications
MVC Frameworks for building PHP Web ApplicationsVforce Infotech
 
Hello Drupal!
Hello Drupal!Hello Drupal!
Hello Drupal!Acquia
 

Ähnlich wie Building API's (20)

Contributing to Drupal
Contributing to DrupalContributing to Drupal
Contributing to Drupal
 
Domas monkus drupal module development
Domas monkus drupal module developmentDomas monkus drupal module development
Domas monkus drupal module development
 
Adapter design-pattern2015
Adapter design-pattern2015Adapter design-pattern2015
Adapter design-pattern2015
 
Intro to drupal
Intro to drupalIntro to drupal
Intro to drupal
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure
 
Drupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsDrupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutions
 
Creating Drupal A Module
Creating Drupal A ModuleCreating Drupal A Module
Creating Drupal A Module
 
Bending the odoo learning curve - Odoo Experience 2015
Bending the odoo learning curve - Odoo Experience 2015Bending the odoo learning curve - Odoo Experience 2015
Bending the odoo learning curve - Odoo Experience 2015
 
Enterprise PHP
Enterprise PHPEnterprise PHP
Enterprise PHP
 
Introducing drupal
Introducing  drupalIntroducing  drupal
Introducing drupal
 
Making The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowMaking The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To Swallow
 
Recipe of a rockstar developer
Recipe of a rockstar developerRecipe of a rockstar developer
Recipe of a rockstar developer
 
Drupal
DrupalDrupal
Drupal
 
Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
Drupal: blog and beyond
Drupal: blog and beyondDrupal: blog and beyond
Drupal: blog and beyond
 
REPL-driven development with pry
REPL-driven development with pry  REPL-driven development with pry
REPL-driven development with pry
 
MVC Frameworks for building PHP Web Applications
MVC Frameworks for building PHP Web ApplicationsMVC Frameworks for building PHP Web Applications
MVC Frameworks for building PHP Web Applications
 
Hello Drupal!
Hello Drupal!Hello Drupal!
Hello Drupal!
 
The Drupal Way
The Drupal WayThe Drupal Way
The Drupal Way
 

Kürzlich hochgeladen

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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.pdfsudhanshuwaghmare1
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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 DiscoveryTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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...DianaGray10
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Kürzlich hochgeladen (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Building API's

  • 1. Building API’s A.K.A. making your module extensible
  • 2. Who Am I? Adam A. Gregory Drupal Developer, Themer, Consultant, and Trainer Using Drupal For 5+ years Built and maintain numerous modules/themes on Drupal.org Been involved in Drupal projects large and small Recently released my first API module, Piecemaker API, & currently converting the Theme Editor module to more of an API in D7
  • 3. What We’ll Cover What is an API How it applies to building modules How do I code an API module? Planning Proper structures (hooks, classes) Drupal Coding Standards Code, Test, Code, Test Give Examples (example.api.php) Release into the wild Real World Examples
  • 4. What is an API? Application Programming Interface Allows other code/programs/modules/etc. to reutilize it’s utilities, resources, and/or services Provides a more efficient code base in Drupal (ussually) Drupal is essentially a big API, or rather a group of API’s
  • 5. How do I code an API module? Code, Pray, Test, Yell, Throw computer in pool, Give up, Become a monk.
  • 6. Planning A good plan violently executed now is better than a perfect plan executed next week. - General George S. Patton Use a whiteboard, mindmap, pad of paper Think through possible uses, by both devs and end users Steal ideas! (It’s OK, that’s what Open Source is for)
  • 7. Proper Structures Classes Drupal is moving slowly but surely to a more OOP approach so try to plan for that. In D7 there is auto loading of Classes so it makes for more efficient code. In order to utilize classes you must initialize classes dynamically, not statically. (May also apply to methods depending on your module use) Classes can easily be extended so they are preferable.
  • 8. Proper Structures Hooks You can write an entire API that only utilizes hooks. Hooks will be needed even in API that are mostly OOP. The entire Drupal system was built as a hooker so it is easily understood by most developers
  • 9. Drupal Coding Standards In order for your module to be extensible it MUST, MUST, MUST conform to Drupal coding standards and practices. Common mistakes Not using a theme() function for ANY html output Not using drupal_alter() to allow other modules access Not Documenting properly: PHPDoc, example.api.php
  • 11. Give Examples Document you code thoroughly Use your own hooks if possible Provide an example.api.php that shows some implementations of your hooks and classes Code the first module that implements the API and include it.
  • 12. Release it into the wild! You’ve done it right? Not so fast my friend… No you have to support it. Provide documentation on Drupal.org Answer Issues Fix bugs Provide Support Make improvements Make new releases Lather, Rinse, Repeat
  • 13. Lets Look At Some Code Views, Fields, Piecemaker
  • 14. Q&A You ask. I answer. Lets keep it simple… Not the questions, just the subtitle.
  • 15. Adam A. Gregory Web: Causecast.org NewhallWeb.com Twitter: @adamgregory Email: arcaneadam@gmail.com Adam@NewhallWeb.com Drupal: arcaneadam