Skip to main content

New answers tagged

2 votes

Which approach to specifying a database connection in an API, is preferred?

Approach B is preferrable because this allows you to isolate application environments from one another, and this limits the blast radius of performance and functional problems. For example, why bog ...
Greg Burghardt's user avatar
4 votes

API Design: Should I explicitly check for and throw on nullptr parameters if I have full control?

Even with the "nullptr check" your code is not safe. Because you don't prevent usage of Window *window after calling windowDestroy. The way of coding you show us here is typical for C (well, ...
freakish's user avatar
  • 3,085
1 vote

API Design: Should I explicitly check for and throw on nullptr parameters if I have full control?

Another option is to re-design the API so that the error doesn't occur. void windowDestroy(Window &window) { glfwDestroyWindow(window.handle); } bool windowShouldClose(const Window &...
Hans Olsson's user avatar
1 vote

System design for tracking viewed posts and returning unseen posts

things get a little tricky with two systems Indeed. So stick with the "one system" approach you initially outlined, where a NOT IN join pushes the problem down to the RDBMS query planner. ...
J_H's user avatar
  • 7,911
1 vote

API Design: Should I explicitly check for and throw on nullptr parameters if I have full control?

Background: I am guided in design decisions by DbC. The OP two-line implementation is nice and is almost enough: void windowDestroy(Window *window) { glfwDestroyWindow(window->...
J_H's user avatar
  • 7,911
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
1 vote

Should pagination metadata like totalCount be included in the ETag for cached paginated API responses?

I think you are missing the main issue. The problem is how do you calculate the etag for the second and subsequent requests without doing the entire db query again. If you keep the query result in ...
Ewan's user avatar
  • 84.4k

Top 50 recent answers are included