Encourage more usage of
PHP Interfaces in Drupal
Better Core. Better Modules. Better Drupal.




   Chris Charlton - XTND....
PHP Interfaces implements

Maps out required functions a Class file implements.
Multiple Interfaces allowed per Class file.
...
PHP Interfaces usage example

<?php

/**
  * Query builder for SELECT statements.
  */
class SelectQuery extends Query imp...
Interfaces used in over 20
instances of Drupal 7 core


 Queries & DB Engine
 Queues
 File transfers
class Drupal implements IDrupal


 Attract OOP-based followers (PHP, Java, etc.).
 Represents a level of code maturity (an...
Upcoming SlideShare
Loading in …5
×

DrupalCon Developer Summit 2010 lightning slides: Encourage usage of PHP Interfaces In Drupal

1,539 views

Published on

My lightning slides for the Developer Summit taking place a couple days before the DrupalCon 2010 San Francisco event.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,539
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

DrupalCon Developer Summit 2010 lightning slides: Encourage usage of PHP Interfaces In Drupal

  1. 1. Encourage more usage of PHP Interfaces in Drupal Better Core. Better Modules. Better Drupal. Chris Charlton - XTND.US - http://xtnd.us
  2. 2. PHP Interfaces implements Maps out required functions a Class file implements. Multiple Interfaces allowed per Class file. Can be extended using the extends operator. Prevents errors and misspellings of functions/hooks. Smart IDE software use Interface files as blueprints.
  3. 3. PHP Interfaces usage example <?php /** * Query builder for SELECT statements. */ class SelectQuery extends Query implements SelectQueryInterface { // ... }
  4. 4. Interfaces used in over 20 instances of Drupal 7 core Queries & DB Engine Queues File transfers
  5. 5. class Drupal implements IDrupal Attract OOP-based followers (PHP, Java, etc.). Represents a level of code maturity (and complexity). Next-gen Module / Theme Engine development? Might be too soon for Drupal. D9? D10?

×