Skip to main content

New answers tagged

0 votes

Should I instantiate controllers in route modules or use static methods?

Neither. Embrace the functional and modular paradigm instead. All of the Node + Express examples I've seen use the router as a simple series of callbacks, essentially. I haven't seen any object-...
Greg Burghardt's user avatar
0 votes

Should I instantiate controllers in route modules or use static methods?

I’d like to understand the trade-offs regarding scalability and testability. Looks to me like there's no scalability and testability, because your current approach does stuff with router and ...
guest271314's user avatar
2 votes
Accepted

Is it okay to mix OOP and modular approaches when building a backend with TypeScript/JavaScript?

Most contemporary programming languages allow to use different paradigms like OOP or functional programming. This alone is neither good nor bad per se. However, when those different styles are mixed ...
Doc Brown's user avatar
  • 220k
1 vote

Is exposing full backend entities to a Vue frontend a bad practice? A case for DTOs?

Sometimes it is possible to push entities through HTTP API but usually it quickly causes problems you are experiencing (and many others you did not mention). Adding translation layer will make your ...
Sankozi's user avatar
  • 189
-4 votes

Is exposing full backend entities to a Vue frontend a bad practice? A case for DTOs?

You are wrong. The ideal scenario is where all your apps share the same domain model, this makes for the most flexible solution with no translation layers, reusable APIs and minimizing bandwidth via ...
Ewan's user avatar
  • 84.4k
0 votes

How can I efficiently handle click events and sequentially related operations (like user–URL deactivation) in a scalable URL shortener?

Is this Redis buffer + periodic sync approach suitable for this kind of workflow? Yes, Although I would try and avoid having expensive Redis if possible. You could do the same with a local memory ...
Ewan's user avatar
  • 84.4k
5 votes

How can I efficiently handle click events and sequentially related operations (like user–URL deactivation) in a scalable URL shortener?

But with thousands or millions of clicks, this becomes a bottleneck Well, have you tested it to be able to assert that? You can't just guess bottlenecks in software development—chances are, you'll ...
Arseni Mourzenko's user avatar

Top 50 recent answers are included