R.E.A.D: Four steps for selecting the right modules

A presentation at Drupal BADCamp in October 2015 in Berkeley, CA, USA by Michael Miles

Slide 1

Slide 1

R.E.A.D How to Select the Right Modules 2015.badcamp.net/node/169 Badcamp 2015 #badcamp

Slide 2

Slide 2

Michael Miles From: Boston, MA USA Work: Genuine @WeAreGenuine(.com) Exp: Working with Drupal since 2008. Acquia Grand Master. 2014 Acquia MVP. Twitter: @mikemiles86 Drupal.org: mikemiles86 All the Places: mikemiles86 mike­miles.com

Slide 3

Slide 3

Goals of this Session Outline steps to decide between contrib, patched or custom module. Demonstrate the effectiveness of R.E.A.D Teach great habits for making module selections

Slide 4

Slide 4

What it is all About How to make smart, timely and informed decisions.

Slide 5

Slide 5

Why this is Important All projects are subject to these three constraints. Need to be able to quickly and correctly make the right decisions for how to build functionality.

Slide 6

Slide 6

R.E.A.D Research what exists Evaluate the options Analyze the gaps Determine changes

Slide 7

Slide 7

Badcamp presents A Real World Scenario Produced by Mike Miles

Slide 8

Slide 8

Starring A Drupalist Everyones favorite hero. Will see him go through the 4 steps of R.E.A.D to make a decision on how to build the required functionality.

Slide 9

Slide 9

Research What Exists How and where to find modules to meet your needs.

Slide 10

Slide 10

Isolate Functionality Keywords Gather all documentation, specs, notes, etc… Ask questions about any assumptions Highlight, circle, mark unique nouns and verbs

Slide 11

Slide 11

Perform Searches 30K+ modules on Drupal.org Favorite Search Engine, “Drupal [keywords]” Drupal.org, “[keywords]”

Slide 12

Slide 12

Utilize the Community Ask for help on IRC: #drupal, #drupal­support Find Drupal group on favorite social network(s) Talk offline at meetups, camps and cons.

Slide 13

Slide 13

Act 1: Research What Exists

Slide 14

Slide 14

Act 1, Scene 1: Isolate Keywords WHEN saving a file entity AND it is a jpeg image THEN the exif meta data needs to be captured AND mapped to custom fields AND these mappings need to be exportable using features Compiling information about his requirements, our Drupalist highlights the terms he thinks are important, terms that he can search for modules with.

Slide 15

Slide 15

Act 1, Scene 2: Perform Searches Drupalists takes the keyowrd “Exif” and performs a Google search. Immediatly has a list of potential modules to use.

Slide 16

Slide 16

Act 1, Scene 3: Utilize the Community » The topic for #drupal is: #drupal is for general chitchat, quick questions, and community talk drupalist Does anyone know how to capture exif data from jpeg images? typhonius drupalist: Running it through Imagick would probably get you exif. chargingHawk drupalist: What are you trying to do with the exif data? drupalist chargingHawk: When a user is uploading a jpeg I need to map the exif data to some custom fields. chargingHawk drupalist: Are you using File Entities? or just an image upload field? peebz is now known as afk_peebz chargingHawk Because Exif Custom might do what you are looking for chargingHawk Exif Custom? Druplicon Exif Custom module allows automatic population of fields from the EXIF, XMP and IPTC metadata tags. http://drupal.org/project/exif_custom woogman masher: Did you ever write that migrate class? drupalist chargingHawk: I am using File Entities. Exif Custom sounds like it does what I might need. Thanks! drupalist chargingHawk++ | Our Drupalist signs onto the #drupal IRC channel and talks to the community for help. Community offers a potential module.

Slide 17

Slide 17

Evaluate the Options Using metrics to determine the best fit.

Slide 18

Slide 18

Gain General Understanding Read the description and linked documentation Answer “What does it do and not do?” Answer “What does it depend on?”

Slide 19

Slide 19

Community Adoption Downloads vs. Installs vs. Age Activity of the issue queue Issues and bugs are good! (to a point)

Slide 20

Slide 20

Maintainer Activity Participation in the issue queue Acceptence of feedback Regularity of commits and releases

Slide 21

Slide 21

Act 2: Evaluate the Options Our Drupalists takes a potential option “Exif Custom” and evaluates it.

Slide 22

Slide 22

Act 2, Scene 1: Gain General Understanding Drupalists reads the description and quickly knows what the module does and what it depends on. Describes much of the functonality he is looking for.

Slide 23

Slide 23

Act 2, Scene 2: Community Adoption Sees that it has not been downloaded or installed much. But it is a specific use case. Issue queue seems to have some activity.

Slide 24

Slide 24

Act 2, Scene 3: Maintainer Activity From issue queue, Drupalist sees that maintainer participates. Also notices that maintainer seems active and releases updates.

Slide 25

Slide 25

Analyze the Gaps Understanding what it does vs. what you need it to do.

Slide 26

Slide 26

Test the Module Download into a sandbox (simplytest.me) Discover what is offered out of the box How does it meet your needs

Slide 27

Slide 27

Discover Missing Functionality What does the module not do? Missing 20%? Missing 80%? Bigger the gap = larger amount of effort

Slide 28

Slide 28

Check for Community Solutions Look at the issue queue Search “Drupal [module] [functionality]” Close gaps with community help

Slide 29

Slide 29

Act 3: Analyze the Gaps Drupalist has evaluated “Exif Custom” to be a best fit. Needs to see what gaps it may have.

Slide 30

Slide 30

Act 2, Scene 1: Test the Module Downloads to local environment and can quickly setup and map exif data to fields

Slide 31

Slide 31

Act 2, Scene 2: Discover Missing Functionality Discovers that there is not Features support, so mappings cannot be exported to other environments.

Slide 32

Slide 32

Act 2, Scene 3: Check for Community Solutions Drupalist turns back to the issue queue, to see if the general use case of Features has been solved. Is not able to find a solution to the gap.

Slide 33

Slide 33

Determine Changes What is needed to close any gaps.

Slide 34

Slide 34

Review the Code Does it follow standards? Is it extendable with APIs & hooks? Understand how functionality works?

Slide 35

Slide 35

Evaluate Changes How much code needs to be changed? Would changes extend? Would changes alter?

Slide 36

Slide 36

Estimate Effort How complex are the changes? How confident in ability to make changes? Is there enough time to make changes?

Slide 37

Slide 37

Act 4: Determine Change After discovering the gap of Features support. Drupalist needs to determine how much would have to change.

Slide 38

Slide 38

Act 4, Scene 1: Review the Code

<?php //… function exif_custom_get_mapping(){ //First try and get users default $mid = exif_custom_get_user_default(); //Else use site default or item 0 if($mid === FALSE){ $mid = exif_custom_get_mid(variable_get(‘exif_custom_default’, ”)); } $sql = “SELECT * FROM {exif_custom_mapped_fields} WHERE mid = :mid AND img_field != $return = db_query($sql, array( ‘:mid’ => $mid ))->fetchAllAssoc(‘img_field’); return $return; } function exif_custom_mappings(){ $output = ”; $mappings = _exif_custom_get_maps(); if($mappings == false){ $output .= ‘<p>You have not yet created any mappings.<p></p>’; } else { $site_default_mid = exif_custom_get_mid(variable_get(‘exif_custom_default’ Drupalist notes that code follows standards. He can read and understand what functions he’d need to use to build in Features support.

Slide 39

Slide 39

Act 4, Scene 2: Evaluate Changes port p u s tures a e F add o t e Hav Requires a dding mac hine_nam es would be extending the module Drupalist qeustions what changes he’d need to make to implement Features support.

Slide 40

Slide 40

Act 4, Scene 3: Estimate Effort Changes t o module are minim al Lots of Features documentation, confident can add code ime. t f o a lot e k a t ot Will n Drupalist determines changes are minimal as is the effrort. He has enough skill and time to make the needed changes.

Slide 41

Slide 41

Making The Choice What to do with all the data

Slide 42

Slide 42

Potential Solutions Use a contrib module Use a contrib module with community solution Patch a contrib module Build a custom module

Slide 43

Slide 43

Go with the Flow R.E.A.D is a flow you can follow to reach the right solutions. Each step is ultimetly a question.

Slide 44

Slide 44

Solution Percentages In general most likely will use a contrib module with or without community solutions or your own patch. Very rarely will you need to write a custom module.

Slide 45

Slide 45

Act 5: Making The Choice

Slide 46

Slide 46

Act 5, Scene 1: Go with the Flow Going through each steps and asking himself the questions our Drupalists decides that the correct path is to use Exif Custom and patch in Features support.

Slide 47

Slide 47

Act 5, Scene 2: Solution Being a good member of the community, the Drupalists provides his Features patch back to the module. The active maintainer sees the benefit and merges it in.

Slide 48

Slide 48

R.E.A.D Research what exists Evaluate the options Analyze the gaps Determine changes

Slide 49

Slide 49

Slides & Notes bit.ly/bc15READ bit.ly/bc15READslides bit.ly/drupalREAD

Slide 50

Slide 50

Thank You! Feedback @mikemiles86 #badcamp Questions? #badcamp @WeAreGenuine R.E.A.D / Michael Miles