I think we all agree that JSON deserialization is one of the most common tasks we as developers of #Dart and #Flutter applications, have to perform regularly, which means that implementation efficiency in this area has a significant impact on the overall speed and ease of the development. Yet over and over I see a few pretty common scenarios.
Some folks prefer to do JSON deserialization manually, which is more time-consuming and error-prone than using code generation. And even if they do use code generation, they’d have data models with JSON deserialization logic, corresponding domain models with similar structure, and mappers that copy data back and forth between data and domain models, maybe with slight modifications.
Clearly, such an approach has a big benefit: if there's a change in the data structure received from the backend, the required application change is minimal and is contained in the deserialization logic, so that the domain model structure remains unchanged and thus no further updates are required in the business logic layer and above. This is a very important benefit, and in my session “Is your JSON deserialization implementation efficient?” at the #FullStackFlutterConference, I’ve shown how to achieve the same result with less code.
The recording is already available on my YouTube channel, linked below!
Engineering leadership @ Airbyte | Dev tools | Opensouce
4mo👋 Hi! I'm an engineering manager at Airbyte, working on Connector Builder and the low-code CDK. Thank you for the overview and for mentioning our work! 🖤 You called out a few things that we've also noticed and already improved on: > The YAML code is long and repetitive and thus tedious and error-prone to write by hand. Airbyte’s connector builder GUI helps generate it – but along with the advantages of a GUI over code come also limitations, such as lack of automation and customization. Yep! Up until a couple months ago, the YAML files that Builder produced had repeating blocks, and the structure overall was quite difficult to work with outside of the Builder UI. We've fixed that: - DRYed it out, no repetitive blocks anymore. - Schemas are now in their own top-level block in the bottom of the file, and they're referenced in the streams. We have quite a lot of Airbyte-supported low-code connectors, and sometimes we had to edit those by hand — it's now a much nicer experience. 1/2 part 2 in thread.