Top Banner
42

Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Jul 19, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development
Page 2: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Decoupling Drupal modules into PHP libraries

Bojan Zivanovic

Coding and Development

Page 3: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Commerce Development Lead @ Commerce Guys

Bojan Zivanovic (bojanz)

Views Bulk Operations, Inline Entity Form

Page 4: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Commerce GuysParis | London | Ann Arbor, MI

Creators of Drupal Commerce and Platform.sh

Page 5: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development
Page 6: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

4 YEARS SINCE THE FIRST RELEASE...

Page 7: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

And now we start from scratch

Page 8: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Re-evaluating our problem space

Page 9: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Libraries first

Page 10: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development
Page 11: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development
Page 12: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development
Page 13: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development
Page 14: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development
Page 15: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Influenced/Infiltrated

Page 16: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

More to come

Page 17: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Why?■ Re-examine your problem space.

■ Get additional exposure.

■ Validate your implementation

■ Get development/maintenance help.

■ Allow for backports.

Page 18: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

The (not so) hidden cost

Page 19: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

The anatomy of a library

Page 20: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Data model - The interfaces

Page 21: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Data model - The default class

Page 22: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Data model - Traits

Page 23: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Data model - Collections

Page 24: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Data model - Repository

Page 25: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Services

Page 26: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Tests (PHPUnit)

Page 27: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Tips & Tricks

Page 28: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Translatable strings

Page 29: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Pluggable implementations

Page 30: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Know when to stop

Page 31: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Drupal integration

Page 32: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Composer

Page 33: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Composer, part II

https://bojanz.wordpress.com/2015/09/18/d8-composer-definitive-intro/

Page 34: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Entity types

Page 35: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Library ideasWhich problems to tackle

Page 36: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Hard problems

Page 37: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Boring problems

Page 38: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

“Nobody cares about your CartInterface"– Me

Are you saving me time?

Page 39: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Spreading the drop

Page 40: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Questions?

Page 41: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development

Sprint: Friday

https://www.flickr.com/photos/amazeelabs/9965814443/in/faves-38914559@N03/

Sprint with the Community on Friday.

We have tasks for every skillset.

Mentors are available for new contributors.

An optional Friday morning workshop for first-time sprinters will help you get set up.

Follow @drupalmentoring.

Page 42: Decoupling Drupal modules...Decoupling Drupal modules into PHP libraries Bojan Zivanovic Coding and Development