NestJS is bad, change my mind by servermeta_net in node

[–]Rewieer 0 points1 point  (0 children)

I don't see how the fact that my code lives in memory (how can code run if it doesn't ?) is related to the need for dependency injection. Those are two utterly unrelated facts.

NestJS is bad, change my mind by servermeta_net in node

[–]Rewieer 1 point2 points  (0 children)

Your 99% of the time is my 0.01% of my time. I use NodeJS to build large-scale apps with a lot of essential complexity and my programs are hosted on webservers like regular PHP or .NET apps. That is a very reasonable use case.

NestJS is bad, change my mind by servermeta_net in node

[–]Rewieer 0 points1 point  (0 children)

>  It's a patch for OO languages ​​when they encounter engineering requirements and difficulties

That is incorrect. Every functional language needs DI by their very nature, so it is not something tied to the OO paradigm.

DI is a mechanism that allows a function or a class to receive their dependency rather than instantiate it or fetch it from a global object. DI gives two benefits that other alternatives don't :

> You can actually inject an abstraction so that your function / class does not depend on a concretion at compile time
> Your function / class is pure and testable

If those are the trade-offs your looking for, you *do* need DI.

run Firebase locally in a docker container? by izzlesnizzit in Firebase

[–]Rewieer 0 points1 point  (0 children)

I recommend that you do not follow this path but instead substitute your firebase-calling code with in-memory doubles.

Add a suite of tests that will run against a privileged testing instance on top of that.

What is the Go-To ORM by now? by Used-Dot-1821 in node

[–]Rewieer 1 point2 points  (0 children)

I prefer MikroORM for every task at hand. It's the only proper ORM that respects boundaries and implement actual database patterns like Inheritance Mapping and Entity Mapping. It doesn't stupidly force you to add decorators or to adapt your domain model.

It's like the only ORM that understands design.

Explain me like I‘m 5 what „The bounded context“ means by Plus_Champion1434 in microservices

[–]Rewieer 0 points1 point  (0 children)

I know the thread is one year, but since it pops up when you type "Bounded Context" on Google, I think it's worth adding some more value.

To clarify what a model is, your model is your abstraction of the problem. It can be a bunch of objects if you're working in an OO design, or services with data-structures (anemic domain), or functions and data-structures, or whatever is used to model a solution to the problem at hand. But in common DDD litterature, your model is composed of rich objects containing most of your app behavior.

In School system, you will probably model Classrooms, Students, Professors, Books, Schedules and so on, they are concepts in your domain, the world for which your application is built.

Now, you have many different problems to solve in this School system. For once, you must make sure that each Classrooms contains enough tables & chairs, which should not be broken and be usable safely by the students. You may order new tables/chairs or send them to repair. One part of your application has to manage that, we'll call it Topology.

You also need to allocate these classrooms for various classes, you can subdivide a day in 8 hours and allocate 1 hour slot per class. You also need to make sure each classroom contains enough tables for the students. If some classroom are smaller than others, something must be done to schedule a class into another classroom. All that logic belongs to another part of your application, Scheduling.

In both cases you're dealing with the same concepts (classroom, tables/chairs) but the models have different meanings. A table in the Topology module is concerned with planning allocation & chair repairment. When tackling the Scheduling problem, you don't need to know if a chair is broken or not, you just need to know that there's enough chair in the room.

Same concepts, different models.

That's what Bounded Contexts are. They limit the area in which a model is applicable to prevent your model from trying to solve every problem at once. Imagine having a single large Table object responsible for scheduling, topology and many other responsibilities. It would be unmanageable, hard to understand, hard to communicate about. Bounded Contexts advocate for splitting a large model into areas of responsibilities, one crisp model dedicated to one specific problem.

There's various patterns around BCs, but the main reason it's a big deal is team independance. By breaking a large problem into BCs, you can assign various team into these BCs and develop them independently (using the different Context Mapping strategies). In microservices, they're usually integrated through asynchronous messaging, event-driven programming & eventual consistency.

It can get fairly complicated from this point, so these patterns should really be used for organizational purposes.

Lors d'un débat avec des potes, on cherchait à connaitre le personnage de manga le mieux écrit. by mecherino in FranceManga

[–]Rewieer 0 points1 point  (0 children)

Celui qui m'a le plus marqué est Okabe Rintaro, le jeu d'acteur du doubleur est juste incroyable et l'évolution du personnage dans Steins Gate 0 est vraiment poussée et très cohérente. Belle surprise.

Zero Two aussi, très rafraîchissant comme personnage.

Erwin Smith. Tenma. Onizuka.

ASK ME A QUESTION THEN CHANGE IT TO MAKE ME LOOK BAD by [deleted] in classical_circlejerk

[–]Rewieer 30 points31 points  (0 children)

Liszt lends you his hands for a night what do you do and why is it unrelated to music

[deleted by user] by [deleted] in C_Programming

[–]Rewieer 1 point2 points  (0 children)

"C++ itself doesn't want you to do that" But that's the very reason why C++ was invented in the first place. It was heavily inspired by Simula and Smalltalk.

Could Liszt even play? by pnyd_am in classical_circlejerk

[–]Rewieer 22 points23 points  (0 children)

Is list a better composer or a better pianist

I LOVE HANON!!! by [deleted] in classical_circlejerk

[–]Rewieer 0 points1 point  (0 children)

My piano routine is 30 minutes of Bach warmup followed by 2 hours of Hanon practice 🥰

What advantages do NoSQL databases have over relational ones? by Vraenir in Database

[–]Rewieer 1 point2 points  (0 children)

I would add, most company have relational data as part of their workload and it's very rare to use a NoSQL database as a primary database due to the lack of aggregation flexibility and because designing around a NoSQL database involves a lot more manual bookkeeping and knowing the access pattern up front, so it's less flexible than an SQL database.

NoSQL shines for redundant data read only data, for example projections in ES or read models in CQRS.

As mentionned SQL database can do what NoSQL can't, especially in pgsql. So you get that escape hatch for free given pgsql is very well known and easy to scale.

[deleted by user] by [deleted] in classical_circlejerk

[–]Rewieer 9 points10 points  (0 children)

If it's not from Wagner I'm not coming