No video

Command & Memento Patterns in Typescript (No BS TS Series 2 Episode 4)

  Рет қаралды 10,056

Jack Herrington

Jack Herrington

Күн бұрын

Пікірлер: 48
@WesleyHandy
@WesleyHandy 2 жыл бұрын
Folks, you will get the best out of these videos if you code along with him. Stop and start to keep up with the pace. But doing will really help solidify the principles. These are useful and helpful examples, Jack!
@jherr
@jherr 2 жыл бұрын
Yes! Triple Yes! Yes! Yes! Yes!
@matthew1106
@matthew1106 2 жыл бұрын
Jack you are killing it this year. You really are filling the void of intermediate/advanced topics in web dev ecosystem. Almost everything is beginner only.
@omarkarim9298
@omarkarim9298 2 жыл бұрын
Couldn’t agree more, great level up channel
@aminomar7890
@aminomar7890 2 жыл бұрын
His book “NO BS TS”, is very valuable, he is talented as a teacher too, I suffered a lot by jumping from place to place, there was no good explanation, missing important points, especially I am not that type who just keep digging without understanding the details, I wasted a lot of time till I found his valuable book. I can’t recommend it enough!
@jherr
@jherr 2 жыл бұрын
Thank you so much!
@aminomar7890
@aminomar7890 2 жыл бұрын
@@jherr I have noticed your clean code, that’s why I got your book, but I was surprised how it is well organised and easy to understand, because of the details and your method probably. thanks it was so helpful.
@aminomar7890
@aminomar7890 2 жыл бұрын
@@jherr question please: about the updates , Is all I need to get the updates to click the link again ? I mean to get the updated version of the book.
@jherr
@jherr 2 жыл бұрын
@@aminomar7890 Every time I put out a new chapter in the book you'll get an update in the email. The last update was last week. This week will not have a new No BS TS video, but the week after will, and you will get an update in the email a day before.
@robwatson826
@robwatson826 Жыл бұрын
This was one of my favourite videos of yours to date. A great topic and some really interesting (and surprisingly simple) implementations! Great stuff Jack
@kr30000
@kr30000 2 жыл бұрын
Absolute perfection when it comes to explaining these topics with the examples, practical uses and different coding styles. I don't know if this would be useful as a future video idea, probably a very niche topic, but it could be cool to have the CommandStack tag each command with an id and maybe return the id on the execute method of the CommandStack class. It could extend the functionality to be able to undo only a specific command in the stack, or async undo. The `git revert` command comes to mind, but also other programs that show you the history of changes as a list to the side
@jherr
@jherr 2 жыл бұрын
I was actually going to do that, but the example just got a little to complex to make for a reasonably comprehensible video.
@edgaremmanuel3197
@edgaremmanuel3197 2 жыл бұрын
you are doing an awesome job.
@VelizFrancia2012
@VelizFrancia2012 2 жыл бұрын
just wow, thanks!
@FilipCodes
@FilipCodes 2 жыл бұрын
Wow awesome. Saved for later 😄
@mostafahamid9479
@mostafahamid9479 2 жыл бұрын
Really professional
@info662
@info662 2 жыл бұрын
Could we use Private class features instead? since they're truly private variables. Thanks a lot for your high quality content
@jherr
@jherr 2 жыл бұрын
Yes, and I should have.
@eminqasimov3398
@eminqasimov3398 2 жыл бұрын
I think command pattern is more flexable than memento, most times you need interact with backend api. saving json state will not be helpfull in memento, with command you can easly define undo function (doing some async api requests)
@jemesmemes9026
@jemesmemes9026 2 жыл бұрын
This should get added to the playlist. It's not in there yet.
@jherr
@jherr 2 жыл бұрын
Very true, will do!
@ahmadalmasri1583
@ahmadalmasri1583 2 жыл бұрын
you are the best
@drvictor666
@drvictor666 2 жыл бұрын
Amazing episode and series + I'm buying the book for xmass :) One question to the Command class implementation - why is the Command defined as an abstract class, rather than an interface which the command sub-classes would then implement rather than extend?
@jherr
@jherr 2 жыл бұрын
If the base class isn't doing anything then you should use an abstract class. It just flattens the hierarchy and makes for more performant code.
@drvictor666
@drvictor666 2 жыл бұрын
Well, if I have a concrete (non-abstract) class B which extends a concrete Class A, I won’t be able to say that B also `implements` an interface I if that one is defined as an abstract class. Because, while a class can `implement` any number of interfaces, it can `extend` only one parent. If the interface I is defined as an `interface` (a blueprint without any implementing code), you can still create an abstract class which would `implement` the interface, perhaps writing concrete code for some of the required methods while leaving the rest of them as `abstract` (thus, forcing the child classes to “complete” the implementation). This would also mean the original, un-related class B, which is from an entirely different family, can still skip the abstract class and implement the interface I directly in its own way. Unless, of course, I’m mistaken or waving around with outdated knowledge, eh, sweating already :)
@chauklaus2693
@chauklaus2693 2 жыл бұрын
functional programming in JS/TS 🥺 please?
@francis_n
@francis_n 2 жыл бұрын
yes would love to see this. Pleaase make functional programming videos Jack
@user-ny6tx5qk8b
@user-ny6tx5qk8b 2 жыл бұрын
Master, i have a question.What `s the difference between class type and function type? And is this programming style(implement with function) belonging to functional programming, or where can I learn this kind of functional writing style systematically
@jherr
@jherr 2 жыл бұрын
I'm hesitant to say that it's "functional programming" since I'm not a functional programming expert.
@eminqasimov3398
@eminqasimov3398 2 жыл бұрын
When I see copilot autocompletes codes it blows my mind. I am on waitlist for a long time. but still they not give access to me. does someone know?
@Messirobben047
@Messirobben047 2 жыл бұрын
Jack, Why does your terminal says ".... on (east -1)" ?
@jherr
@jherr 2 жыл бұрын
Dude, I honestly don't know. 😂 It's just a Mac. It's not like I'm on AWS or anything. If you have any ideas lemme know.
@jherr
@jherr 2 жыл бұрын
Actually, I think it's an interaction between the AWS dev tools and Oh-My-ZSH. I could remove that from my prompt. I'm just lazy.
@aminam9201
@aminam9201 2 жыл бұрын
could you please mention the extension name for the sketch ?
@jherr
@jherr 2 жыл бұрын
draw.io - marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio
@aminam9201
@aminam9201 2 жыл бұрын
​@@jherr thanks, you are generous, helpful and awesome.
@thatboyneedstherapy
@thatboyneedstherapy 2 жыл бұрын
Sorry if this is super basic, but why do you use a ref for todoText? (24:51)
@jherr
@jherr 2 жыл бұрын
That's what is called an uncontrolled input: reactjs.org/docs/uncontrolled-components.html It's a simple an lightweight way to read from, or set, an input.
@thatboyneedstherapy
@thatboyneedstherapy 2 жыл бұрын
Thank you!
@ngneerin
@ngneerin 2 жыл бұрын
Please give examples where these patterns are used in real applications
@jherr
@jherr 2 жыл бұрын
Sure, in this case it would be an Do/Undo/Redo feature. And you would see those in SPA applications like Figma, Google Docs, anything where you are editing something and want the customer to be able to recover from accidental edits.
@ngneerin
@ngneerin 2 жыл бұрын
@@jherr most of these patterns are useful only on the frontend as you play with the same state. Backend could hardly use these. Because it's stateless or has its state stored in db. Correct me if I am wrong
@jherr
@jherr 2 жыл бұрын
​@@ngneerin I disagree. Thus far we have covered Factory, which is great for managing global configuration and resources (e.g. database connections) on the backend. Publish and Subscribe, which is an insanely powerful backend concept for doing workload distribution and doing workflow work. And Visitor and Iterator, which I used to do paged API access, which is very valuable in backend work for ETL and ML.
@ItsAqib
@ItsAqib Жыл бұрын
Which VS Code theme and fonts are you using in this video, Sir...??
@stephenbeattie
@stephenbeattie Жыл бұрын
Check the comments on Jack's videos. He has this info and more.
@georgekalogeropoulos1813
@georgekalogeropoulos1813 2 жыл бұрын
Why do you not save it as json and you save it as string
@jherr
@jherr 2 жыл бұрын
JSON is a string format.
@NolanZewariligon
@NolanZewariligon Жыл бұрын
Simply exposing object's state publicly isn't the Memento pattern. Memento should be opaque to the public - no public API. Only the object who creates the memento should know how to handle it. Since TypeScript doesn't have friend classes like C++, I guess Memento should be a base class with everything private except the protected constructor that creates the memento metadata, and the method that reconstructs the state from memento-ed metadata. Then the class that derives the memento can expose the API to get and set mementos publicly without the public knowing anything about what's in the memento. And then another class can keep the reference to the derived class and be in charge of keeping mementos and undoing.
TypeScript Factory Patterns (No BS TS Series 2 Episode 1)
22:07
Jack Herrington
Рет қаралды 34 М.
Five Essential Design Patterns in Typescript
49:31
Jack Herrington
Рет қаралды 60 М.
Schoolboy Runaway в реальной жизни🤣@onLI_gAmeS
00:31
МишАня
Рет қаралды 2,6 МЛН
Harley Quinn's plan for revenge!!!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 33 МЛН
Please Help Barry Choose His Real Son
00:23
Garri Creative
Рет қаралды 21 МЛН
Пройди игру и получи 5 чупа-чупсов (2024)
00:49
Екатерина Ковалева
Рет қаралды 3,3 МЛН
Real-Life Case of the Command Design Pattern
32:25
ArjanCodes
Рет қаралды 42 М.
React 19's useOptimistic: EVERYTHING you NEED to know
25:24
Jack Herrington
Рет қаралды 14 М.
Surviving the AI-Driven Job Market
13:05
Jack Herrington
Рет қаралды 31 М.
No BS TS 34 - Typescript Decorators
17:08
Jack Herrington
Рет қаралды 19 М.
Design Patterns: Command/Memento
31:08
Microsoft Visual Studio
Рет қаралды 34 М.
What is the Command Pattern? (Software Design Patterns)
19:55
Be A Better Dev
Рет қаралды 16 М.
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,2 МЛН
How He Got $600,000 Data Engineer Job
19:08
Sundas Khalid
Рет қаралды 24 М.
Command Pattern - Design Patterns (ep 7)
39:12
Christopher Okhravi
Рет қаралды 268 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 250 М.
Schoolboy Runaway в реальной жизни🤣@onLI_gAmeS
00:31
МишАня
Рет қаралды 2,6 МЛН