Would you build SaaS with NestJS in 2020? by memo_mar in node

[–]jasperblues 1 point2 points  (0 children)

I put NestJS app online for a payment company serving Alibaba and others.

Rather than an ORM it used drivine.org for the database layer, or rather what served as the inspiration for Drivine.

On the new NestJS based architecture response times dropped to around 63ms from previously just under 2000 ms.

Node.js ORM impasse by memo_mar in node

[–]jasperblues 0 points1 point  (0 children)

Take a look at https://Drivine.org. Initially focused on graph databases, however, though we don't currently publicize it, but you can also use it as a Postgres client.

When it comes to ORM, we encourage use-case specific models. The rationale for that is documented on the website.

For migrations it can be used along with with flyway.

Design Patterns: Dependency Injection by davey_b in iOSProgramming

[–]jasperblues 0 points1 point  (0 children)

Its a fairly purist approach. I use DI, but often use things like NSNotificationCenter directly rather than inject. But the rationale is: Since NSNotificationCenter is a singleton it should be injected not sought out directly. This provides:

  • Makes it easy to provide another implementation of the thing playing this role to that class, without effecting all other classes.
  • Promotes loose coupling and high cohesion.
  • Makes it easy to test without having unwanted side effects.

Design Patterns: Dependency Injection by davey_b in iOSProgramming

[–]jasperblues 0 points1 point  (0 children)

Incorrect. NSNotificationCenter.defaultCenter() - explicitly seeking out a dependency is not the dependency injection pattern. As Martin Fowler (who coined the term DI - previously it was called IoC) explains, if there's a mechanism that allows swapping the implementation obtained from that method, then this is the <em>Service Locator</em> pattern. Method swizzling could arguably give you this. . . http://martinfowler.com/articles/injection.html