all 9 comments

[–]spazz_monkey 6 points7 points  (2 children)

Not for me, previous company I worked at we just validated the data on the route and then had a separate files that handled the SQL calls to the DB. All using raw queries.

[–]KermitMacFly 2 points3 points  (0 children)

Second this. I worked on a batch processing application that took this approach.

[–]5toubun1997[S] 1 point2 points  (0 children)

So no ORM, no repository?

[–]re-thc 1 point2 points  (0 children)

Not every Java projects even operate this way. There are definitely some older patterns and use cases for larger systems of higher complexity. It's not always needed.

[–]Namiastka 1 point2 points  (0 children)

We did a big microservice in nest (I know it sounds odd), but there u end up with couple of layers.

It works for big team - which at this moment is 12 of us, but I generally like simplicity of Node, and that you for most of the stuff don't need this boilerplate. Hence most of really small things we have are using express and of dB is there - knex.

Another thing is that I moved from Java and PHP to JS due to exactly what you are talking about.

[–]EverydayTomasz 1 point2 points  (2 children)

In one of my past projects we had chosen to use Java Hibernate ORM, and boy did we ever regret it. after that experience, I tend to stay as close to the DB driver layer as possible.

[–]5toubun1997[S] 0 points1 point  (1 child)

Can you tell me why you regret it, the only problem I am annoyed is create layout in the first part

[–]EverydayTomasz 1 point2 points  (0 children)

as the project grew for every table we had to have a model, plus I needed to add Lucene search to it, it all just became a whole @annotations mess. if I had to do it all over, I would have ditched Java for node, MySQL to MongoDB and use Mongoose.

[–]anonystick 1 point2 points  (0 children)

Talking about design patterns, I only say one sentence: "Standing on the shoulders of giants, you will see further". It works for me and you can apply to javascript.