J-Fall 2021: Nick Tinnemeier – Don’t tell my manager I generate my code – how we autogenerated the dull parts of our REST service.

 

I was once told that a good programmer is a lazy programmer. A good programmer avoids typing tedious code, where the code could basically write itself. Self-writing code – wouldn’t that be great? Unfortunately, we’re not quite there yet. In this talk we show you how to be lazy though. We demonstrate how 1) the “Swagger codegen” plugin generated our REST interface classes and DTOs from an OpenAPI spec, 2) the “Immutables” framework generated immutable domain objects and 3) “MapStruct” alleviated us from the dull task of writing code to copy the autogenerated object models one to another, field by field. All of this integrated nicely with our Spring Boot service only having to write a few lines of code. Did we lose you? No worries, we give you a whirlwind introduction to all of this. After this talk you can directly start with *not* writing code. And please *do* tell your manager you generated all your code, because now you have all the time to focus on the fun stuff, like writing docs. 😉

(Visited 1 times, 1 visits today)

About The Author

You might be interested in