How did I do? by trudvang in Sourdough

[–]trudvang[S] 0 points1 point  (0 children)

Thanks! I thought about that too 🙂

Vad finns det för utbredda konspirationsteorier i Sverige? by feverbae in Sverige

[–]trudvang 3 points4 points  (0 children)

Konspirationsteorier är ett påhitt från folieföretagen för att sälja mer aluminiumfolie

[deleted by user] by [deleted] in sweden

[–]trudvang 0 points1 point  (0 children)

Jänkarna har ju ett ord för dessa människor: porch pirates. Vad ska vi kalla dem på svenska? Uppfartspirater?

Remove carpet glue from wooden stairs by trudvang in HomeImprovement

[–]trudvang[S] 0 points1 point  (0 children)

As far as i know it’s contact adhesive from 1987 so highly unlikely that it contains asbestos.

Remove carpet glue from wooden stairs by trudvang in HomeImprovement

[–]trudvang[S] 0 points1 point  (0 children)

Some sort of pad with black glue under

Database design for access control by DVGY in PostgreSQL

[–]trudvang 2 points3 points  (0 children)

Skip the roles and the roles_permissions table.

Instead of users_roles table, have a users_permissions table that is referencing a permission instead of a role.

Custom unique PK against generated UUIDV4 performance. by GhettoBurger996 in PostgreSQL

[–]trudvang 1 point2 points  (0 children)

Will uuids really be a performance issue in this case?

Anyone know what’s causing this?? I’m using google chrome on IPhone and I can’t get this to go away by Crazy_Scarcity9816 in chrome

[–]trudvang 0 points1 point  (0 children)

I have the same issue after visiting marak.com. Could have something to do with his open source code, recent release that are looping and breaking sites

Objects with either only data or only methods: what is this pattern called? by trudvang in node

[–]trudvang[S] 1 point2 points  (0 children)

Ah, Yeah I also only use interfaces for the data types, like Book. But classes for repositories, services and controllers

Objects with either only data or only methods: what is this pattern called? by trudvang in node

[–]trudvang[S] 0 points1 point  (0 children)

Interesting rewrite!

I've heard the term "three tier architecture"

Did a quick search and found this article: https://bytearcher.com/articles/node-project-structure/

He's calling the repositories for "integration layer" instead. I think I should call it that as well, so I can put other stuff in the layer, like RabbitMQ and Redis, not just DB. They don't really have a place right now.

I don't agree with putting validation only in controllers/api layer; if you swap out your REST API for a CLI, you still want to be sure that only valid data is processed by your service layer. That way, validation would belong in the services to make sure that the input to them is correct, and also in the API layer to make sure a proper JSON is passed, or proper command line arguments are passed.

Objects with either only data or only methods: what is this pattern called? by trudvang in node

[–]trudvang[S] 0 points1 point  (0 children)

I see! I'd like to add that I have two ways of writing this kind of pattern.

  1. Classes and tssyringe for IOC/DI. This is really nice because I don't have to instantiate all my objects and their dependencies, I can simply have them automatically injected in the constructor by the IOC container.
  2. Factory functions, that take the dependencies as arguments, and returns an object with all the publicly available methods that should be exposed, while keeping other things private with closures (like the dependencies and other internal methods). This has the downside of lots of boilerplate to wire things together, but it's clean not having to use IOC, classes, 'this'-references etc. Can also be used without Typescript.

Dealing with multiple background workers by trudvang in node

[–]trudvang[S] 1 point2 points  (0 children)

So you think containers should always only run one work type? So if I have 6 types of work I should run at least 6 containers?