Upgrade to Pro — share decks privately, control downloads, hide ads and more …

You need an AutoMapper, but you don't know it yet!

You need an AutoMapper, but you don't know it yet!

It is quite common for a developer to have to map data. In the long run, this kind of code is boring to write. Why not generate it automatically? This is the promise that AutoMapper tries to solve: generating the code needed to map one data to another (array, class, etc.)

Through this talk, we will first see the Symfony Serializer and how it works.

Then, we will discover how AutoMapper takes advantage of the Serializer ecosystem while revolutionizing the Normalizer concept by adding code generation, thus drastically boosting performance!

Baptiste Leduc

June 17, 2021
Tweet

Other Decks in Technology

Transcript

  1. You need an AutoMapper, but you don't know it yet!

    Baptiste Leduc Dev @JoliCode @Korbeil_
  2. How the serializer uses them? Priorities: - GetSetMethodNormalizer: N/A -

    PropertyNormalizer: N/A - ObjectNormalizer: -1000
  3. - 2016 JSON Schema - 2016 OpenAPI 2 - 2019

    OpenAPI 3 - 2018 AutoMapper
  4. Or improve the Serializer ? https://github.com/symfony/symfony/issues/30818 - decoupling features from

    AbstractObjectNormalizer - merge the 3 big normalizers in one - hard dependency on symfony/property-info and symfony/property-access component