Vor der Fusion: Unitymedia-CEO wechselt auf die Insel

heise online Newsticker - 4. Juli 2018 - 7:30
Lutz Schüler wird Unitymedia verlassen und heuert als COO bei der Liberty-Tochter Virgin Media in Großbritannien an. Sein Nachfolger wird Winfried Rapp.

PreviousNext: Decoupling the model from Drupal

Planet Drupal - 4. Juli 2018 - 1:17

Back in the Drupal 6 days, I built the BOM Weather Drupal module to pull down weather data from the Australian Bureau of Meteorology (BOM) site, and display it to users.

We recently had a requirement for this in a new Drupal 8 site, so decided to take a more modern approach.

by Kim Pepper / 4 July 2018 Not that kind of decoupled Drupal

We often hear the term Decoupled Drupal but I'm not talking about a Javascript front-end and Drupal Web Service API backend.

This kind of decoupling is removing the business logic away from Drupal concepts. Drupal then becomes a wrapper around the library to handle incoming web requests, configuration and display logic.

We can write the business logic as a standalone PHP package, with it's own domain models, and publish it to Packagist.org to be shared by both Drupal and non-Drupal projects.

The Bom Weather Library

We started by writing unit-testable code, that pulled in weather forecast data in an XML format, and produced a model in PHP classes that is much easier for consuming code to use. See the full BOM Weather code on GitHub 

For example:

$client = new BomClient($logger); $forecast = $client->getForecast('IDN10031'); $issueTime = $forecast->getIssueTime(); $regions = $forecast->getRegions(); $metros = $forecast->getMetropolitanAreas(); $locations = $forecast->getLocations(); foreach ($locations as $location) { $aac = $location->getAac(); $desc = $location->getDescription(); /** @var \BomWeather\Forecast\ForecastPeriod[] $periods */ $periods = $location->getForecastPeriods(); // Usually 7 days of forecast data. foreach ($periods as $period) { $date = $period->getStartTime(); $maxTemp = $period->getAirTempMaximum(); $precis = $period->getPrecis(); } }

The library takes care of fetching the data, and the idiosyncrasies of a fairly crufty API (no offence intended!).

Unit Testing

We can have very high test coverage with our model. We can test the integration with mock data, and ensure a large percentage of the code is tested. As we are using PHPUnit tests, they are lightning fast, and are automated as part of a Pull Request workflow on CircleCI.

Any consuming Drupal code can focus on testing just the Drupal integration, and not need to worry about the library code.

Dependency Management

As this is a library, we need to be very careful not to introduce too many runtime dependencies. Also any versions of those dependencies need to be more flexible than what you would normally use for a project. If you make your dependency versions too high they can introduce incompatibilities when used a project level. Consumers will simply not be able to add your library via composer.

We took a strategy with the BOM Weather library of having high-low automated testing via CircleCI. This means you test using both: 

composer update --prefer-lowest

and

composer update

The first will install the lowest possible versions of your dependencies as specified in your composer.json. The second will install the highest possible versions. 

This ensures your version constraints are set correctly and your code should work with any versions in between.

Conclusion

At PreviousNext, we have been using the decoupled model approach on our projects for the last few years, and can certainly say it leads to more robust, clean and testable code. We have had projects migrate from Drupal 7 to Drupal 8 and as the library code does not need to change, the effort has been much less.

If you are heading to Drupal Camp Singapore, make sure to see Eric Goodwin's session on Moving your logic out of Drupal.

Tagged Decoupled Logic, PHP Libraries, Composer, PHP Unit

Mediacurrent: Good People, Good Marketing: A Podcast Interview with Mediacurrent’s Dave Terry

Planet Drupal - 3. Juli 2018 - 21:31

What’s the greatest entrepreneurship lesson that Mediacurrent partner Dave Terry has learned?

In a recent guest spot on the Good People, Good Marketing podcast, Dave weighs in on the evolution of open source technology and shares his path to building a leading Drupal-based agency.

Interview Sound Bites 

Technology should be shared and free. 

 

Giving back to the Drupal community is embedded in Mediacurrent’s DNA. Dave explains why that’s so important.

Culture is about people and who we hire. I know a lot of companies say that, but it’s really about putting the processes behind how you identify the right people within the company.

 

A successful company culture attracts great talent while also managing accountability with a distributed team. Here, Dave shares the three tenets of culture at Mediacurrent.

Tune in

Listen to the complete podcast, Episode 47: Interview with Dave Terry, on the Sideways8 blog.

Related Content 
Why Should Companies Support Drupal? | Blog
Drupal Contrib: Why it's Important | Video
Creating a Culture of Giving in Your Organization | Blog
 

Dries Buytaert: Why large organizations are choosing to contribute to Drupal

Planet Drupal - 3. Juli 2018 - 21:27

During my DrupalCon Nashville keynote, I shared a brief video of Mike Lamb, the Senior Director of Architecture, Engineering & Development at Pfizer. Today, I wanted to share an extended version of my interview with Mike, where he explains why the development team at Pfizer has ingrained Open Source contribution into the way they work.


Mike had some really interesting and important things to share, including:

  1. Why Pfizer has chosen to standardize all of its sites on Drupal (from 0:00 to 03:19). Proprietary software isn't a match.
  2. Why Pfizer only works with agencies and vendors that contribute back to Drupal (from 03:19 to 06:25). Yes, you read that correctly; Pfizer requires that its agency partners contribute to Open Source!
  3. Why Pfizer doesn't fork Drupal modules (from 06:25 to 07:27). It's all about security.
  4. Why Pfizer decided to contribute to the Drupal 8's Workflow Initiative, and what they have learned from working with the Drupal community (from 07:27 to 10:06).
  5. How to convince a large organization (like Pfizer) to contribute back to Drupal (from 10:06 to 12:07).

Between Pfizer's direct contributions to Drupal (e.g. the Drupal 8 Workflow Initiative) and the mandate for its agency partners to contribute code back to Drupal, Pfizer's impact on the Drupal community is invaluable. It's measured in the millions of dollars per year. Just imagine what would happen to Drupal if ten other large organizations adopted Pfizer's contribution models?

Most organizations use Open Source, and don't think twice about it. However, we're starting to see more and more organizations not just use Open Source, but actively contribute to it. Open source offers organizations a completely different way of working, and fosters an innovation model that is not possible with proprietary solutions. Pfizer is a leading example of how organizations are starting to challenge the prevailing model and benefit from contributing to Open Source. Thanks for changing the status quo, Mike!

Japan: Rakete geht kurz nach Start in Flammen auf

heise online Newsticker - 3. Juli 2018 - 18:30
Die Rakete Momo-2 des japanische Privatunternehmens Interstellar Technologies ging kurz nach dem Start in Flammen auf und explodierte nahe der Startrampe.

"Facebook-Steuer": Uganda besteuert mobile Nutzung sozialer Medien

heise online Newsticker - 3. Juli 2018 - 18:30
Von den rund 40 Millionen Ugandern nutzen etwa 17 Millionen mobiles Internet.

VW-Chef: Festnahme von Audi-Chef Stadler war "Riesenschock"

heise online Newsticker - 3. Juli 2018 - 18:00
Er habe Rupert Stadler als Problemlöser und Aufklärer erlebt, sagt VW-Chef Diess in einem Interview. Die Festnahme des Audi-Chefs sei ein Riesenschock gewesen.

Internetkonsum von Kindern: Gauck warnt vor sozialer Spaltung

heise online Newsticker - 3. Juli 2018 - 17:30
Im übermäßigen Internetkonsum und dem Erziehungsstil der Eltern sieht der Alt-Bundespräsident Gefahren für Kinder.

Europäisches Patentamt: Große Baustellen für den neuen Präsidenten

heise online Newsticker - 3. Juli 2018 - 16:30
Der neue Präsident des Europäischen Patentamts hat viel zu tun: Konflikte mit Mitarbeitern und Kritik an der Prüfungspraxis bestimmten die letzten Jahre.

Studium geschmissen, Job gefunden: Chancen für Studienabbrecher

heise online Newsticker - 3. Juli 2018 - 16:30
Fast jeder dritte Student kehrt der Uni nach einigen Semestern wieder den Rücken. Gescheitert sind sie aber nur auf den ersten Blick.

Trekstore Primetab T13B: Stärken und Schwächen des günstigen Surface-Clones

heise online Newsticker - 3. Juli 2018 - 16:00
Mit dem Primetab T13B liefert Trekstor ein 2-in-1-Gerät für unter 400 Euro. Im Test haben wir das Windows-Tablet genauer unter die Lupe genommen.

Nicht von dieser Welt: Fabelwesen feiern die "Comic Con Germany"

heise online Newsticker - 3. Juli 2018 - 16:00
Pause vom normalen Leben. Zur Comic Con Germany strömen tausende Fans, viele aufwendig geschminkt, verkleidet, und längst nicht nur Jungs in Superman-Kostümen.

Missing Link: "Es gibt keine Pflegeroboter"

heise online Newsticker - 3. Juli 2018 - 16:00
Angesichts der wachsenden Zahl pflegebedürftiger Menschen und des Mangels an Pflegekräften streben viele eine technische Lösung an: Pflegeroboter. Was ist dran?

Was war. Was wird. Mit unktrolliertem Zucken über kontrollierte Zentren.

heise online Newsticker - 3. Juli 2018 - 16:00
Lagerkoller allenthalben, und WM-Gejammer. Der normale Mensch fragt sich, ob alle irre geworden sind. Hal Faber mag die Hoffung auf Vernunft nicht aufgeben.

Zitis: Kernteam der staatlichen Hackertruppe steht

heise online Newsticker - 3. Juli 2018 - 15:30
Bei der Entschlüsselungsstelle sind mittlerweile rund 60 Posten vergeben, Leitungsstellen mit Leuten aus dem sicherheitsindustriellen Komplex besetzt.

Internet Society bekommt Techie als neuen Chef

heise online Newsticker - 3. Juli 2018 - 15:30
Andrew Sullivan will dafür kämpfen, dass das Internet sein "ursprüngliches Versprechen einlösen kann, das Leben rund um den Globus zu bereichern".

Selbstgemachtes im Netz: Dawanda schließt Handelsportal

heise online Newsticker - 3. Juli 2018 - 15:30
Dawanda gibt auf: Das Portal für Selbstgemachtes, lange als deutsche Erfolgsgeschichte im Netz gehandelt, schließt.

"Technische Irregularitäten": NSA muss Millionen Metadaten löschen

heise online Newsticker - 3. Juli 2018 - 15:00
Die NSA ist dabei, ihr gesamtes Reservoir an Verbindungsdaten zu bereinigen, nachdem zu viele Kontaktpersonen von Verdächtigen erfasst worden waren.

Wie viele DNS-Root-Server braucht das Internet heute?

heise online Newsticker - 3. Juli 2018 - 14:30
Das DNS-Rootserver-System freundet sich mit einer Multi-Stakeholder-Selbstverwaltung an. Betreiber wollen neue Stellen für Management und Qualitätskontrolle.

Billiger Gameboy-Klon mit Retro-Games im Test

heise online Newsticker - 3. Juli 2018 - 13:30
Bei Amazon lockt ein günstiger Gameboy-Klon mit Farbdisplay. Wir haben uns die mobile Retro-Konsole angesehen und verraten, ob sich die 23 Euro lohnen.