The Right way to write Nest.js & Typescript clean-code - SOLID

The Right way to write Nest.js & Typescript clean-code - SOLID

CoderOne

11 месяцев назад

77,773 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Stas Panyukov
Stas Panyukov - 26.11.2023 14:28

Unfortunately not many js developer are even noticed about these principles

Ответить
LHRGames
LHRGames - 23.11.2023 12:40

very good video =))

Ответить
cédric
cédric - 16.11.2023 12:34

Hey great video, why the storage fecther is an abstract class and not an interface

Ответить
Nhật Nguyễn Hữu
Nhật Nguyễn Hữu - 15.11.2023 10:58

I have a doubt about the S principle, if do it like this, the code in the controller is quite long, and corresponds to business, somehow it is not good for reusable functionality right? Just kinda view from mine! Anyone can help me on it? Or do we have to make trade-offs?

Ответить
Rdoze TV
Rdoze TV - 10.11.2023 22:20

In single responsibility principle you could also use events to decouple

Ответить
S1DEV
S1DEV - 01.11.2023 21:18

soo good, would you make more videos on nestjs design concepts

Ответить
slah Omar
slah Omar - 29.10.2023 17:42

in 8.17, when you're filling the paymentGateways ?

Ответить
TheBeastDispenser
TheBeastDispenser - 03.10.2023 02:10

Thank you for including good and bad examples! By far the best way for me to learn

Ответить
João Paulo Sabino de Moraes
João Paulo Sabino de Moraes - 22.09.2023 22:39

I thought a concrete class should only implement interfaces not abstract classes. Why ts allows that ? Inheritance from class to class I normally use extends. If I want to enforce contract I would use implement from class to an interface

Ответить
Cheng
Cheng - 18.09.2023 16:42

I think logic is not handled on the controller, the controller only forwards requests from view to service and receives response and forwards to view.

Ответить
Code Liam
Code Liam - 15.09.2023 06:04

Very awesome. Thx

Ответить
Ubong Inyang
Ubong Inyang - 14.09.2023 10:56

Nice video man. However, I prefer to use extend, and then make the method in the base class an abstract method as well.

Ответить
Creativogee
Creativogee - 09.09.2023 17:03

In OCP you can extend if the subclass is the same as the base class but with an added functionality. e.g A cock is a bird that can crow. Cock class can extend the bird class which has the fly functionality and then implement its own crow functionality.

Ответить
David Chavez
David Chavez - 05.09.2023 21:28

Is there any reason for using abstract classes instead of interfaces?

Ответить
Muhammad Salman Agustian
Muhammad Salman Agustian - 03.09.2023 13:47

amazing, thanks for the tips. +1 subs

Ответить
Nicolas
Nicolas - 02.09.2023 23:28

Doesn't StorageFetcher breaks LSP?

Ответить
Odair_GB
Odair_GB - 31.08.2023 02:49

good video, like from brazil.

Ответить
beo dan
beo dan - 27.08.2023 05:01

great video
thank for your sharing

Ответить
Esteban Helguero Cardiff
Esteban Helguero Cardiff - 20.07.2023 01:14

Really good video!

Ответить
Onivaldo
Onivaldo - 12.07.2023 19:27

The controller can be replaced with another method because it should not contain business rules. Controllers are responsible for handling requests and delegating the processing to other components. By keeping controllers lightweight and decoupled from business logic, it allows for flexibility and easier replacement with alternative methods or technologies.

Ответить
Yohannes Kindu
Yohannes Kindu - 12.07.2023 10:53

Dude you are very amazing developer, I was just looking around to improve my coding structure and make it more readable, reusable and maintainable, This is the video anyone who wants to look first before writing nest js code. Thank you!!

Ответить
SudacaDev
SudacaDev - 11.07.2023 22:44

Can you create a nestjs tutorial serie?

Ответить
Ivan Velinov
Ivan Velinov - 10.07.2023 15:11

Loved the explanations and everything. Quick thing to add and probably a lot of users do it differently. Using your service as the "Business layer" doesn't mean you write bad code or not clean code. My humble opinion is that, "controllers" should take care only for input and output of the application, nothing else. Service is actually the business part and the clean code should be there. You have to think also about the architecture and controllers should not do business logic. Ofc repository,dao or whatever for the data layer.

Keep with the great stuff :)

Ответить
Emin Aliyev
Emin Aliyev - 04.07.2023 02:26

Very helpful!

Ответить
Mak Henry
Mak Henry - 30.06.2023 19:07

a genius

Ответить
Nabin Saud
Nabin Saud - 27.06.2023 16:28

I love nestjs with graphql

Ответить
Richie Permana
Richie Permana - 26.06.2023 19:54

I really love this NestJS series. Please keep going!!

Ответить
Adiat Hasan
Adiat Hasan - 23.06.2023 00:01

🚀

Ответить
Georgy27
Georgy27 - 15.06.2023 02:51

I am confused with example on GitHub for open closed principle. Should we call registerPaymentGateway in controller? Will this object (paymentGateway) always have only 1 payment method at a time? I thought paymentGateways (the one in paymentService) should have all our relative payments options inside the object, so that when we call processPayment it checks payment method against the one we have. I am just confused the way it’s organised in your GitHub repo) I didn’t even see where you are calling processPayment Method in your code

Ответить
Michel Versiani
Michel Versiani - 14.06.2023 02:27

Amazing as always, thanks for the tips!

Ответить
MAVrikrrr
MAVrikrrr - 13.06.2023 11:54

Don't get the implements against extends part. "extends" is not bad thing and it still covers Liskov principle. If you want to force one (or several) of methods to be implemented in children, you just make the base class abstract and make those methods abstract as well (just like you did in open-close example). "implements" is good when you combine multiple interfaces in one class implementation. But "extends" allows you exactly extend something (not re-implement from scratch). Good overview though.

Ответить
Hanny Fransis
Hanny Fransis - 13.06.2023 00:22

great tips keep going

Ответить
Husam Almaher
Husam Almaher - 12.06.2023 16:33

nice bro please keep updating us with your awesome knowledge about backend specially nest js

Ответить
Gaming Wolf
Gaming Wolf - 12.06.2023 11:55

The last time i want to learn more about this framework , but i didn't get a large community as other frameworks

Ответить
Juneroy D. Quinimon
Juneroy D. Quinimon - 12.06.2023 06:46

Amazing tutorial, thank you!

Ответить
Joseph Joey
Joseph Joey - 12.06.2023 06:05

How does this architecture work with state management sayusing context api or redux toolkit?

Ответить