ActiveRecord and the Beauty Lost in Translation
Published on by Eric L. Barnes
Matthew Machuga writing about the ActiveRecord pattern and his thoughts on it:
Sometime in 2014, PHP-land started to debate whether Active Record was a tolerable ORM pattern, and whether one should use Active Record or Data Mapper ORMs. In PHP, this comes down to something like Laravel’s Eloquent ORM as an Active Record implementation vs. Doctrine, the reigning mainstream (and probably only) PHP data mapper implementation. After a surge of interest in Domain-Driven Design (DDD) and Hexagonal Architecture in the Laravel, and overall PHP communities, people began to detest one of the very things that drew them to the framework in the first place. This was fueled by a number of vocal and notable Laravel community members learning Doctine, talking about it heavily, and some evangelizing it. With outside influence from the PHP world providing the same judgement against the impure Active Record pattern, the pitchforks started to come out from all over.
Eric is the creator of Laravel News and has been covering Laravel since 2012.