Functional web APIs in practice

by | Sep 8, 2022 | Voxxed Days Cluj 2022

Gabriel Bornea is a software engineer who’s been working with JVM languages for over 10 years now. As team lead at ING Hubs Romania, his main expertise is in software architecture for risk assessment, fraud detection and global internet banking features. Before joining ING Hubs Romania, he worked as a programmer for Cegeka and Dell. He is a Scala, F#, and Kotlin enthusiast and founder of the Kotlin user group in Bucharest. Gabriel is into automatic testing and reactive programming and believes that typed functional programming is the best way to write and develop applications with increased maintainability.

Performance, validation, testing, concurrency and dependency injection are some of the aspects that we have to think about when we are designing our APIs. While frameworks usually handle all of these, let’s make an exercise: drop the framework “magic” and see how we can use the Kotlin compiler to do the work for us. 

Using functional programming concepts enhanced by Arrow.kt and describing our business domain as accurately as possible will prevent bugs by increasing error discovery at compile time, reducing and simplifying (no more mocks) unit testing, thus making our programs more predictable.