Frontend data validation for a clean architecture

A hands-on workshop for developers and architects

Wednesday 3rd May 2023, 6:30 - 8:30 pm.

Speaker: Nicole Rauch

Venue: Skyscanner Limited, Quartermile One, 15 Lauriston Place, Edinburgh, EH3 9EN
(Please use Lauriston Place entrance. Note that Skyscanner will require you to sign a Non Disclosure Agreement (NDA) for entry to their offices. Please read the terms here).

Refreshments and networking from 6:00 pm. Refreshments kindly provided by Skyscanner.

This event is free of charge and open to all, though registration is required.

Synopsis

When data is transferred to a JavaScript-frontend, it's not immediately clear how the correctness of the data structures can be established. Even using TypeScript does not help because those types don't exist at runtime. If we load the data into the frontend without checking its correctness, we risk errors due to incorrect data structures. Even worse, those errors can happen at any time!

To avoid these errors, "defensive" programming is often applied. This means that the code is full of null-pointer checks and the like, which reduces readability and maintainability. To improve this situation, we should check the data as soon as it arrives at the frontend, and we should reject it if it doesn't match our expectations. This leads to a clean and slim architecture for the whole frontend.

This workshop introduces the philosophy of frontend validation and gives you a step-by-step, hands-on experience of using a popular validation library called ZOD. You will learn how it helps you work with valid data in the frontend, including the automatic generation of TypeScript types.

Prerequisites and practicalities

For the practical elements of the workshop, participants will ideally have had some exposure to TypeScript or JavaScript. However, knowledge of a similar language that has Generics (e.g. Java, C#, C++) should be sufficient. We will pair those that have actual TS/JS knowledge with less experienced participants.

Bring a laptop with a recent version of Docker, and an IDE (recommended are IntelliJ/WebStorm or VSCode). A docker image will be provided that contains everything that's required - from Nicole's server (https://www.nicole-rauch.de/files/validation.tar.gz) from May 1st OR on a USB stick on the day.

About the speaker

 

Nicole Rauch is an independent software developer and development coach with a solid background in compiler construction and formal methods. Her focus is on Specification by Example and Domain-Driven Design, working with React.js in the frontend as well as working with legacy code. Nonetheless, her secret love is for functional programming. Also, she is committee member and co-organizer of a number of conferences and unconferences and co-founder of Softwerkskammer, the german-speaking Software Craftsmanship community.

Edinburgh Branch site maintained by © Copyright BCS 2023 Legal and privacy notices  BCS is a registered charity: No 292786