DTO (Data Transfer Object) in JavaScript/Typescript

Computer science applied to JavaScript 💪 Practical examples of Clean Code concepts every JavaScript engineer can employ to make the code more scalable and responsive to change. Let’s learn Software Craftsmanship together. DTO (Data Transfer Object) is what is being transferred over the wire. In JavaScript Single Page App, it’s what API expects to create a resource and what it sends back to process and display on the page. Oftentimes DTOs data structures are not the most comfortable to work with for a Frontend engineer. For example, data structures contain dates as strings, boolean values with property names without prefix (is*, has*, should*), flags as an array of strings, or even more cumbersome things — a data structure that is not that comfortable to work with. We, JavaScript engineers, can prevent DTOs leak into our codebase. In favor to keep it evergreen and comfortable for everyone to work with. Let’s learn how to protect the codebase from DTOs. -----------------------------------------------------
Back to Top