I’m designing a backend in TypeScript (could also apply to JavaScript), and I’m wondering about the architectural approach.
Is it better to stick to a single paradigm (e.g., fully object-oriented or fully modular/functional), or is it acceptable — and maybe even recommended — to mix both styles?
For example:
Use an OOP approach (classes, methods, patterns like DAO, Repository, Service) for the business logic layer.
Use a modular approach (functions and exports) for routes and middleware in Express.
So, in practice:
Controllers and repositories → OOP
Routes and middleware → functional modules
Would such a hybrid architecture be considered good design practice, or should a backend project remain consistent with a single paradigm?