No video

TypeScript Factory Patterns (No BS TS Series 2 Episode 1)

  Рет қаралды 34,773

Jack Herrington

Jack Herrington

2 жыл бұрын

No BS TS is back! With the first in an all new series where we cover all the patterns in the original Design Patterns book (and more). This time we are looking at the factory patterns; Abstract Factory, Builder and Factory Method. All of these patterns help you build reusable well architected code.
No BS TS Book: no-bs-ts.mysho...
Code: github.com/jhe...
👉 What's my theme? Night Wolf [black]
👉 What's that font? MonoLisa
👉 Jack is also on the React Round Up podcast: devchat.tv/pod...
👉 Don't forget to subscribe to this channel for more updates: bit.ly/2E7drfJ
👉 Discord server signup: / discord
Thank you for watching this video, click the "SUBSCRIBE" button to stay connected with this channel.
#typescript #nobsTS

Пікірлер: 90
@mrdeurknopp
@mrdeurknopp 2 жыл бұрын
Jack, your content is such a breath of fresh air, most tutorials are aimed at complete beginners which is fine of course but it's nigh impossible to find good tutorials dealing with more advanced concepts, especially when it comes to web development. Cheers man, keep up the good work!
@jherr
@jherr 2 жыл бұрын
Thank you! That's what I'm trying to do!
@aram5642
@aram5642 2 жыл бұрын
Plus, these two windows make a beautiful, live background! Wonderful! Let others stick with dull color gradient lights...
@lawrencejones51
@lawrencejones51 Жыл бұрын
I appreciate concrete implementations of design patterns in Typescript. And I really appreciate seeing *both* a class-based approach and a functional approach. It broadens my mind about the capabilities of TypeScript. Thanks!
@richwatts9546
@richwatts9546 2 жыл бұрын
Absolutely love these "no BS" based videos - only (very subjective) improvement I would like to see is zooming out a little on the IDE!
@Messirobben047
@Messirobben047 2 жыл бұрын
wow, most of the content available online covered patterns using classes, loved that you covered functional aspect. thanks Jack!
@Nonsense116
@Nonsense116 2 жыл бұрын
I'm so excited! I've been digging into a lot of the content you make lately and it has been challenging me to start writing code where I could describe the implementation in a meaningful, decisive, way. The quality and maintainability of code I write has been dramatically changed from these videos! Thank you so much!
@Luxcium
@Luxcium Жыл бұрын
Also in agreement with the other comments on this video we need more tutorials that are made such that beginners can figure out by themselves but where intermediate level script kiddies and other advanced programmers can have fun learning new stuff without having to learn how to install VSCode or NodeJS for the thousandth time 😅😅😅🎉 Jack is great at doing just that, Awesome 👏🏼
@dianrahmaji
@dianrahmaji 2 жыл бұрын
Design Patterns with TypeScript is all i need for now. Thanks!
@chrisjames278
@chrisjames278 2 жыл бұрын
great series, looking forward to the rest of the episodes!
@shashikaxp1
@shashikaxp1 2 жыл бұрын
I don't know what to say, thank you so much for these videos.
@DiegoBM
@DiegoBM Жыл бұрын
Fantastic content Jack! I reckon this has the potential to be a fantastic reference series for most TS developers, but I believe that it could be even more useful if, before jumping into your actual implementations, you could spend a minute or two explaining (and maybe showing the GoF diagram of) the generic pattern, and then, as you're doing, show your example implementation applied to a practical case. That would probably make it perfect.
@abhisheksharma9796
@abhisheksharma9796 2 жыл бұрын
This one was very informative. Thanks for your wisdom, and the art to teach it in such a great format. ✌️
@MK_AU
@MK_AU 2 жыл бұрын
Great video... purchased the book to support this series
@jherr
@jherr 2 жыл бұрын
Thank you so much!
@ngneerin
@ngneerin 2 жыл бұрын
Can you make a tic tac toe or snakes and ladder game using TS with patterns to get actual demonstration of patterns in real world problems?
@vitormalencar
@vitormalencar 2 жыл бұрын
haha please keep the books coming I loved the module federation one and im sure that I will like this one as well
@iamilyes
@iamilyes 2 жыл бұрын
I have been waiting for this serie... Thank you soo much 🙏
@jonasboardwalker
@jonasboardwalker 2 жыл бұрын
I put a like on your video before it has started
@jherr
@jherr 2 жыл бұрын
I won’t tell anybody. 😂
@oumardicko5593
@oumardicko5593 2 жыл бұрын
Oooooh yeah, finally something about design patterns 😍
@jherr
@jherr 2 жыл бұрын
And much more on the way.
@oumardicko5593
@oumardicko5593 2 жыл бұрын
@@jherr can't wait
@cas818028
@cas818028 2 жыл бұрын
You knocked it out of the park Jack with demonstrating both the oop based versions along with the functional. That was lacking in many tutorials. Also I am still trying to hire you! Reach out if interested.
@buchdev
@buchdev 2 жыл бұрын
Great! thanks for sharing those pattern with us. I like so much the factory pattern, i love it!
@jherr
@jherr 2 жыл бұрын
Fantastic! Stick around for more patterns coming soon!
@iuliancarnaru954
@iuliancarnaru954 2 жыл бұрын
I am a fan of the content of this channel, buying the book is a great investment ... click...click... buy!
@jherr
@jherr 2 жыл бұрын
Thank you!
@Billiam112
@Billiam112 2 жыл бұрын
Great stuff. Looking forward to this series! 👌
@tomross4599
@tomross4599 2 жыл бұрын
Love the pattern of your shirt 😊
@yourplayer5
@yourplayer5 2 жыл бұрын
Another use case for the builder pattern that I like to use is to improve readability of A) functions with many parameters or B) complex instantiations of objects.
@jherr
@jherr 2 жыл бұрын
Very true!
@farouktouil5036
@farouktouil5036 2 жыл бұрын
Hi , Jack Congrats for the book,
@jherr
@jherr 2 жыл бұрын
Thanks. I'm hoping that it helps folks get more out of the series.
@technikhil314
@technikhil314 2 жыл бұрын
Wow design patterns BS TS. Didnt saw that coming.
@ryanjensen4232
@ryanjensen4232 Жыл бұрын
You rock man!
@saideepesh6036
@saideepesh6036 2 жыл бұрын
As always awesome content
@yaserghananwi
@yaserghananwi 2 жыл бұрын
Thank you for this tutorial was very 👍
@Cowglow
@Cowglow 2 жыл бұрын
Love the content! Keep up the great work
@ChrisJarzynka
@ChrisJarzynka 2 жыл бұрын
I came for the Typescript and GoF Design Patters but am staying for Uchuu Senkan Yamato! Nice!
@jherr
@jherr 2 жыл бұрын
Hahah! You are the first person ever to notice that!
@babyboie20
@babyboie20 2 жыл бұрын
Getting the book TODAY!!!
@jherr
@jherr 2 жыл бұрын
Thank you!!!
@sagarreddy7461
@sagarreddy7461 2 жыл бұрын
Thanks a lot jack
@bonuocdua
@bonuocdua 2 жыл бұрын
please make a playlist for thisssss
@piotrzajas9014
@piotrzajas9014 Жыл бұрын
Didnt know that Kevin De Bruyne knows TS and design patterns :D. Just kidding ofc, great content ;)
@bafian
@bafian Жыл бұрын
nice
@alexchernenko4901
@alexchernenko4901 2 жыл бұрын
Super!!!
@techworld3043
@techworld3043 2 жыл бұрын
yo ho. I should watch this.
@bonsayeb9620
@bonsayeb9620 22 күн бұрын
Any plans to continue this series? Thanks for the videos
@brunodepaula5293
@brunodepaula5293 4 ай бұрын
Great content! A feedback..The builder example was not that good. Because we sshould not have a file reader that do both json and text. But I understand the idea was to show the builder pattern... A better example could be an OrderBuilder, in which you have functions to add item, add delivery address, ... And then return the builder object on these functions. And then you can fluid create the object like: orderBuilder .addItem("item 1") .addItem("itrm 2") .setDeliveryAddress("address") .build()
@jherr
@jherr 4 ай бұрын
Why wouldn't you want a reader for JSON and a reader for text?
@bachirseghir9952
@bachirseghir9952 8 ай бұрын
Jack , I think you used Template pattern in the directory Scrapper when you transformed it from Builder pattern to Factory pattern , using abstract class and overriding it throught inheritance to include the missing methods isJSONFile , readText and readJSON , isn't it ?
@sairaj5660
@sairaj5660 2 жыл бұрын
Yai 🥳🥳🥳🥳
@Luxcium
@Luxcium Жыл бұрын
I don’t know if KZfaq has a way to link to a playlist inside of the individual videos but some time I see the next video in my suggested next video (in other context or from other KZfaqrs when I am not in the playlist of a series)… I don’t get suggested videos in this series though so I am just curious 🧐
@vijayshankar5250
@vijayshankar5250 Жыл бұрын
Hey dude I've been confused about typescript and zod which one i prefer for my application.typescript offers development experience.but zod offers runtime type checking 🤨
@frederickobeng-nyarko2868
@frederickobeng-nyarko2868 2 жыл бұрын
I don't know, but hearing him speak alone is soothing.. You have no choice but to understand what he's teaching, loool..
@JulioDx3480
@JulioDx3480 2 жыл бұрын
Great video! Thank you. Have you considered releasing a hardcover version of the No BS TS Book when all tutorials are released?
@jherr
@jherr 2 жыл бұрын
Maybe, I could sell it through O'Reilly or something. :)
@jrs_devs
@jrs_devs 2 жыл бұрын
Ey Jack!, This first episode and the 5th of the Series 2 are not included in your No BS TS Playlist
@henrykhosasih8781
@henrykhosasih8781 11 ай бұрын
Hello, I'm new to design patterns. Just wondering if design patterns are used in real world codebases?
@ngneerin
@ngneerin 2 жыл бұрын
Is it that breaking down classes to functionalities such that it can be reusable in different contexts is builder pattern?
@jherr
@jherr 2 жыл бұрын
It's that you are loosening the coupling between the code that creates significant output from the code that figures out whether it should be created. In the case of builder the pattern is that you are passing the building code to the function or class that does the computing or parsing work. You can see this pattern in things like parsing libraries. So you have the parser that goes through the data, and then the builder that gets callbacks when the parser finds important thing and builds the right output.
@alvarobyrne
@alvarobyrne 2 жыл бұрын
Can these/those design patterns be applied/used in react development- I'm just starting to see the chapter and I hear "functional version" so I bet that YES they can... Let´s see...
@jherr
@jherr 2 жыл бұрын
Yes. These can absolutely be used with react, angular or vue.
@vungocduyet1193
@vungocduyet1193 2 жыл бұрын
You forgot to put in No BS TS list
@MartinStarosta
@MartinStarosta 2 жыл бұрын
Please, what VS Code theme is Jack using?
@Boris1990ua
@Boris1990ua 2 жыл бұрын
Great video, but I am a little bit confused 🤔 third example Factory Method looks to me more like Template Method, DirectoryScraper delegates implementation of specific behavior to FileReader, not object creation, why it's a factory?
@jherr
@jherr 2 жыл бұрын
Because the creation of the objects is delegated to abstract "factory" methods. Let's take a database reading class. If it reads from the list of customers and then creates customer objects for each one, then there is a tight coupling there. If it delegates the chore of creating the customer objects to a method, then those can be overridden to create different types of customer objects.
@jherr
@jherr 2 жыл бұрын
Also, the second and third look a lot like the Strategy pattern. :) Lots of these patterns are closely related.
@Boris1990ua
@Boris1990ua 2 жыл бұрын
@@jherr Thanks for clarification👍 I look forward to seeing your next videos.
@TheNsn666
@TheNsn666 2 жыл бұрын
Where do you live ? the view from your window is awesome..
@jherr
@jherr 2 жыл бұрын
Oregon. And that actually is my office window, though it's a plate so that I can do the green screen stuff.
@PS-dp8yg
@PS-dp8yg 2 жыл бұрын
Isn't it an anti pattern not implementing debug and info for ProductionLogger?
@jherr
@jherr 2 жыл бұрын
No, they are implemented as stubs.
@PS-dp8yg
@PS-dp8yg 2 жыл бұрын
@@jherr Thanks for the reply and awesome content. I don't know...having just stubs feels dirty to me.
@jherr
@jherr 2 жыл бұрын
@@PS-dp8yg Fair, but if you don't have them you'd have to do logger.log?.() all over the place and if you miss one... boom goes the dynamite.
@PS-dp8yg
@PS-dp8yg 2 жыл бұрын
@@jherr LOL...fair enough, but what if we create separate interfaces for each consoles and have the clients (DevelopLogger and ProductionLogger) implement what they needed. In this case, DevelopLogger implements all 4 interfaces and have ProductionLogger implements the only 2 interfaces.
@jherr
@jherr 2 жыл бұрын
@@PS-dp8yg So the factory would return IDevelopmentLogger | IProductionLogger? I'm confused.
@nyambe
@nyambe 2 жыл бұрын
I am having some issues with TS and rest calls. Is this covered in no BSTS?
@jherr
@jherr 2 жыл бұрын
In series 1 we cover react and rest calls.
@sebmonti5904
@sebmonti5904 2 жыл бұрын
Is the book a pdf or it is compatible kindle and apple book ? To resize font etc
@jherr
@jherr 2 жыл бұрын
It's just in PDF currently. I tried to render it as an ePUB but the formatting was badly mangled. I'll keep working on it though. I do want it to be available in multiple forms.
@sebmonti5904
@sebmonti5904 2 жыл бұрын
@@jherr will I get the ePub file if you manage to create it later if I purchase the pdf now ?
@jherr
@jherr 2 жыл бұрын
@@sebmonti5904 Yep.
@sebmonti5904
@sebmonti5904 2 жыл бұрын
@@jherr getting the book now ;)
@jherr
@jherr 2 жыл бұрын
@@sebmonti5904 You rock!
Proxy & Flyweight Patterns - No BS TS Series 2 Episode 5
19:20
Jack Herrington
Рет қаралды 10 М.
TypeScript Pub/Sub Patterns (No BS TS Series 2 Episode 2)
22:46
Jack Herrington
Рет қаралды 20 М.
Magic trick 🪄😁
00:13
Andrey Grechka
Рет қаралды 33 МЛН
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 97 МЛН
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
MrBeast
Рет қаралды 149 МЛН
8 Design Patterns | Prime Reacts
22:10
ThePrimeTime
Рет қаралды 402 М.
TypeScript: Should you use Types or Interfaces?
4:06
Matt Pocock
Рет қаралды 154 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 245 М.
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,2 МЛН
Single Responsibility Principle in React (Design Patterns)
16:50
Cosden Solutions
Рет қаралды 47 М.
Factory Method Pattern - Design Patterns (ep 4)
27:21
Christopher Okhravi
Рет қаралды 542 М.
TypeScript Origins: The Documentary
1:21:36
OfferZen Origins
Рет қаралды 282 М.
Five Essential Design Patterns in Typescript
49:31
Jack Herrington
Рет қаралды 59 М.
I Cannot Believe TypeScript Recommends You Do This!
7:45
Web Dev Simplified
Рет қаралды 168 М.
You're Doing React Hooks Wrong, Probably
20:11
Jack Herrington
Рет қаралды 64 М.