Hi, are you going to continue this series? :D I think there are more patterns and you explain them in the right way! Thanks
@sarthaksahu1174 жыл бұрын
Please make videos on more patterns! It is very easy to remember these patterns with the examples you are giving. Thanks!
@creative-commons-videos4 жыл бұрын
Doesn't Circular Dependencies count as a bad practice ? where we require State in Order and Order in State ?
@troglokev6 жыл бұрын
There’s a bit of a code smell here, in that the interface is forcing the implementation of methods for operations that don’t exist in the state diagram.
@estranhokonsta5 жыл бұрын
Not really. The state diagram just show what is 'legal' to do. This pattern strength is that it can react intelligently to any possible transitions, legal or not. It doesn't make assumptions about the capacity of the UI or API to not allow illegal state transitions.
@ChristopherOkhravi7 жыл бұрын
Great idea to exemplify Design Patterns in TypeScript! Subbed 😀
@Cognitoman5 жыл бұрын
ohh shit guess who it is :)
@amitpattjoshi4 жыл бұрын
@@Cognitoman just watched chris video to get the basic clear and your example just helped me to clarify further if any doubt I had. But dont agree with instanciating all concrete states in constructor seems redundent.
@hangchen61317 жыл бұрын
That's a great design pattern tutorial, also can be applied to all programming languages generally.
@TheZoreslav5 жыл бұрын
The best explaining of pattern in js
@willl00144 жыл бұрын
Very well explained sir, and excellent example selection.
@vooose7 жыл бұрын
great series of videos please keep them going
@simplyexplained7 жыл бұрын
Thanks! Any patterns in particular that you would like to see explained?
@vooose7 жыл бұрын
@Savjee I just came across these videos to learn more about TS (rather than design patterns per se) but I find the practical examples easier to learn from than videos specifically about TS language features (tho your other series on TS I still found most useful) - not exactly a design pattern but perhaps a video on TDD (or just unit testing) with TS would be helpful
@narendratechguy71407 жыл бұрын
Why did you stopped developing this series, please complete it
@simplyexplained7 жыл бұрын
+narendra techguy any patterns you would like to see?
@narendratechguy71407 жыл бұрын
Savjee all the patterns that are in GoF
@MrEnsiferum775 жыл бұрын
This is bad implementation of the state pattern, the Order class, does not need to know how to create the classes who implement the state interface and also u breaking open-close principle. Also, classes who implements the state interface, are bound to particular class in this case Order. U need DI with interface, so u can swap Order class in future.
@ojuliomiguel4 жыл бұрын
Do you have this code example with this improvements?
@avimehenwal3 жыл бұрын
Totally agree (Y)
@avimehenwal3 жыл бұрын
Are getters and setters required in this case? I see the class attribute is already set to public at 2:30, i am thinking when property could be directly accessed and changed from outside why have getters and setters? Do they provide any additional value which I might have overlooked? Super thanks for answering my query :)
@simplyexplained3 жыл бұрын
Getters and setters are mainly used to allow you to change underlying structure of your classes without affecting your application itself. Setters are also useful to do validation before accepting values in your application.
@avimehenwal3 жыл бұрын
@@simplyexplained when you say validations that makes sense. Still why have public class attributes then? Doesn't take make the attribute insecure !!! ? We can directly change it from outside using className.attribute = "new value" Doesn't that defeat the purpose of getters and setters in the first place?
@simplyexplained3 жыл бұрын
Oops, yes, they should've been private! This is often a requirement in companies to not have any public attributes.
@avimehenwal3 жыл бұрын
@@simplyexplained Thanks for the closure :) Have a great day
@SportAnalysisKing7 жыл бұрын
I really liked your explanation on StatePattern it was very clear and concise. I would love to see how you implement complex if and else with Rule pattern and Decorator pattern to do logging or anything with decorator but to see logging would be nice
@ayushpratap47265 жыл бұрын
HI Savjee! Really liked all your design patterns videos for typescript! Would really appreciate if you will add more videos to the series! waiting for a very long time ! Please make videos on GANG OF FOUR design Patterns in typescript!
@gbkEmilgbkАй бұрын
what about circular references? Order uses CacneledOrderState, CanceledOrderState use Order - ?
@SibyAugustine937 жыл бұрын
Brilliant tutorial... And if we want to add some other states in future how will we do that? without disturbing current system.
@dmytrosamburskyi10227 жыл бұрын
You are doing great videos. But I have a remark, you don't keep object's properties encapsulated. In most places 'public' properties should be 'private', especially when you have getter and setter or pass an object into constructor. Though the series is about design patterns, it's showing bad habit pattern :)
@simplyexplained7 жыл бұрын
You are 100% right and I normally don't make that mistake. Damn it! Thanks for letting me know. I'll put a warning up in the description!
@okragula6 жыл бұрын
Thanks for the great series, you’ve helped me a lot. I have to ask though (at least what to google for), in the ‘Order state: ‘ log statement, what is the use of in that particular case (I understand that any means of any type, I’ve never seen it used like that.)
@pathakvivek78653 жыл бұрын
Please make such videos of other patterns too..
@93249817 жыл бұрын
Nice series.
@fieldset36895 жыл бұрын
Why using an state Interface instead of a state Class ?
@DanielMunoz-bn6gk6 жыл бұрын
Hi, excellent video. I need you help, i try this pattern with angular 6 but not working, get this error: "Converting circular structure to JSON". I think this is because order have a State field and the state have a order field. Do you know how to solve this problem?
@cedrics73745 жыл бұрын
Hi Daniel, did you find a solution yet? I was planning on using on an Angular 8 project
@ngneerin3 жыл бұрын
Isn't this against DRY principle
@aeromina6 жыл бұрын
Thank you so much for these videos :)
@awsguide29124 жыл бұрын
Thank You a Lot !!
@AmxCsifier7 жыл бұрын
brilliant stuff
@tervancovan Жыл бұрын
this is what I want
@buchdev Жыл бұрын
Why did you used any on line 123? Oh God! you're using typescript, use a type, please
@NulledExp Жыл бұрын
uff some big cycles around, please ffs TELL DONT ASK / LoD? :( I know this video is about State pattern but this can be super dangerous when you try to show how to implement design patterns when u burn the whole base of Design, PLEASE
@AlbertoRivas134 жыл бұрын
This guys doenst have the text editor in dark mode, dislike
@angelhdzdev2 жыл бұрын
This guys doesn't appreciate the amount of free and clear information provided, but complains about colors, dislike