DEV Community

Discussion on: Designing a better architecture for a Node.js API

Collapse
 
pacheco profile image
Thiago Pacheco

Yes, I've being using a normal function approach for a long time too, but applying design patterns using class is really helpful and easy to replicate/add functionalities across your app, this will make your life easier especially on a big project.
For example, if you need to create a new endpoints with the same common functionalities as a CRUD like we did there you won't need to copy and paste code (respecting CLEAN code), you can just inherit all the functionality you have already created somewhere.