Presented by Larry Garfield / @Crell
We have to allow ourselves to break APIs in order to innovate.
GOTO 1
I think I am burned out, I am literally losing sleep over this, but I am too stubborn to care about my own feelings because I know I will have to live with this for the next three years.
— Kris Vanderwater (EclipseGc)
We love long release cycles! Yay stability!
We won't contribute to long release cycles. ROI takes too long.
Sometimes API breaks are necessary in order to evolve.
If you cannot innovate without breaking APIs,
you don't have an API.
Drupal 8 was necessary... but should be rare.
Clear interfaces and real APIs
All of those changes we've been making for the last 2 years
Drupal 8 makes this possible
class BookManager {
public function getAllBooks() {}
}
class BookRepository extends BookManager {
public function doSomethingNew() {}
}
function core_cool_stuff(BookRepository $repository) {
$books = $repository->getAllBooks();
$repository->doSomethingNew();
}
function contrib_cool_stuff(BookManager $manager) {
$books = $manager->getAllBooks();
}
interface OldStyleInterface {
public function foo();
}
interface NewStyleInterface extends OldStyleInterface {
public function bar();
}
function cool_stuff(OldStyleInterface $service) {
if ($service instanceof NewStyleInterface) {
$bar = $service->bar();
}
else {
$bar = "Some previously assumed value.";
}
// ...
}
That's the whole point of interfaces and Dependency Injection
An API is a function that performs an operation on a series of arrays.
— Druplicon
WRONG!
(This is why we can't have nice things.)
But wait, didn't we do that for Drupal 7?
This will be a hard learning experience
But it's how we have our (cup)cake and eat it to
This is the only hard problem. It's solvable.
Dries talks about Drupal growing up
Welcome to adulthood
(Please have exact change)