Benz
Benz
Benz
Benz
Benz
Benz
Benz
file name

Benz Platform

what Goran did

Drupal / PHP
JavaScript

Description

The Benz Platform is a Drupal multisite project that powers multiple benefit sites, which share most functionalities. Some sites require content to be grouped by country, region, or other criteria, while others do not. If the content grouping feature is enabled, content is shown based on the selected group. Initially, the platform powered a few sites, but over time, this number grew to 20+ sites.

I joined the project as a senior developer, tasked with updating functionality for one of the platform's features. After spending some time working on the project, I noticed certain issues related to both back-end and front-end implementations. As the number of sites grew, maintaining the platform became more complex, and changes to functionalities required significantly more time and costs.

 

Challenges

Increased Complexity: As the number of sites increased, maintaining the platform became more complicated, and implementing changes took longer.

Custom Services Issues: Previously, custom services did not implement interface classes, leading to confusion about required and helper methods and a lack of documentation.

Method Duplication: Some methods contained large blocks of code, resulting in multiple methods with similar or duplicated code.

Content Group info: Data about content groups (e.g., group code, homepage url) was needed on almost every page request.

JavaScript Libraries: Many sites shared similar JavaScript functionality but had separate libraries.

 

Solutions

Custom Services Rewrite: Rewrote custom services to implement interface classes, improving documentation and clarity on required and helper methods.

Method Simplification: Simplified methods by separating large blocks of code into action-specific methods, making the code more readable and reusable.

Caching Implementation: Created a method to process and cache content group data, which is then used from the cache as long as it remains valid.

JavaScript Optimization: Consolidated JavaScript functionality into configurable theme-level differences and implemented custom hooks for additional overrides, allowing most JavaScript libraries to be written globally.

Ongoing Feature Development and Refactoring: Continuously developed new features while refactoring the content grouping functionality, which was integral to the platform.

 

Results

Stabilized Platform: The platform became significantly more stable.

Maintenance and Development: Maintenance and development of new functionalities became easier and faster.

Enhanced Performance: Performance improvements were achieved.

Reduced Dependencies: Managed to eliminate some contrib modules.

Do you like what Goran did there?

For some gold, Goran will do that for you, too!

contact the Goran