Комментарии:
Unfortunately not many js developer are even noticed about these principles
Ответитьvery good video =))
ОтветитьHey great video, why the storage fecther is an abstract class and not an interface
Ответить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?
ОтветитьIn single responsibility principle you could also use events to decouple
Ответитьsoo good, would you make more videos on nestjs design concepts
Ответитьin 8.17, when you're filling the paymentGateways ?
ОтветитьThank you for including good and bad examples! By far the best way for me to learn
Ответить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
Ответить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.
ОтветитьVery awesome. Thx
ОтветитьNice video man. However, I prefer to use extend, and then make the method in the base class an abstract method as well.
Ответить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.
ОтветитьIs there any reason for using abstract classes instead of interfaces?
Ответитьamazing, thanks for the tips. +1 subs
ОтветитьDoesn't StorageFetcher breaks LSP?
Ответитьgood video, like from brazil.
Ответитьgreat video
thank for your sharing
Really good video!
Ответить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.
Ответить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!!
ОтветитьCan you create a nestjs tutorial serie?
Ответить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 :)
Very helpful!
Ответитьa genius
ОтветитьI love nestjs with graphql
ОтветитьI really love this NestJS series. Please keep going!!
Ответить🚀
Ответить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
ОтветитьAmazing as always, thanks for the tips!
Ответить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.
Ответитьgreat tips keep going
Ответитьnice bro please keep updating us with your awesome knowledge about backend specially nest js
ОтветитьThe last time i want to learn more about this framework , but i didn't get a large community as other frameworks
ОтветитьAmazing tutorial, thank you!
ОтветитьHow does this architecture work with state management sayusing context api or redux toolkit?
Ответить