The Flyweight Pattern Explained and Implemented in Java | Structural Design Patterns | Geekific

  Рет қаралды 25,925

Geekific

Geekific

Күн бұрын

Support us on Patreon: / geekific
GitHub Repository: github.com/geekific-official/...
Stay updated on our videos by subscribing to the channel and hitting the like button!
Today, we add another Structural design pattern to our Design Patterns in Java series: The Flyweight Design Pattern.
Timestamps:
00:00 Introduction
00:07 What is the Flyweight Pattern?
02:05 Flyweight Pattern Implementation
04:58 The Flyweight Pattern Class Diagram
06:22 Recap
06:52 Thanks for Watching!
If you found this video helpful, check other Geekific uploads:
- Introduction to Design Patterns: • What are Design Patter...
- UML Class and Object Diagrams: • UML Class and Object D...
- SOLID Principles and Best Practices: • SOLID Design Principle...
- Object-Oriented Programming Fundamentals: • What is Object-Oriente...
- Recursion Made Simple, Recursive Methods: • What is Recursion? | R...
- The Factory Method Pattern Explained and Implemented in Java: • The Factory Method Pat...
- New Features introduced in Java 17: • New Features in Java 1...
#Geekific #DesignPatterns #FlyweightPattern #StructuralPatterns

Пікірлер: 32
@alooooshm
@alooooshm 2 жыл бұрын
Dude in 7mins you are delivering more value than that delivered in a 3-hour lecture...! Thx
@geekific
@geekific 2 жыл бұрын
Thank you! This means a lot :)
@mishaaskar
@mishaaskar Ай бұрын
@@geekific funny enough my OOP class in uni pretty much copied this playlist word by word for any explenation about design patterns
@RyanJones-qo2hn
@RyanJones-qo2hn 2 жыл бұрын
This video is amazing. What I really appreciate is your ability to articulate WHY we would use this pattern. As a beginning computer programmer, this is helping me properly contextualize the content to make it more "sticky" in my head. Thank you so much for sharing your knowledge with the world!
@geekific
@geekific 2 жыл бұрын
When I was in your shoes I had the same struggles :) and while making the videos I try to answer: "I wish someone explained to me this and that at the time...". Am so glad the videos are helping you! Cheers!
@ThanhNguyen-qk2zb
@ThanhNguyen-qk2zb Жыл бұрын
Very nice and clear video for me. Thank you very much, sir! I can now understand this pattern in 7mins
@harveynorman8787
@harveynorman8787 8 ай бұрын
This is a very good explanation of flyweight. Thumbs up
@Sarah-zo2ys
@Sarah-zo2ys 2 жыл бұрын
This was very easy to understand, thank you!!! 😁
@geekific
@geekific Жыл бұрын
I'm so glad it was :)
@freeopensource
@freeopensource 2 жыл бұрын
This one was good. Thanks for helping me out !! Also explaining on slides with code example helps understand betterr (which this one was) rather typing in real time and swithching multiple screen.
@geekific
@geekific 2 жыл бұрын
Thank you! Happy it helped :)
@michaelgoppelt3326
@michaelgoppelt3326 2 жыл бұрын
Great content. You deserve more followers
@geekific
@geekific 2 жыл бұрын
I appreciate that! Glad you liked it :)
@mirageman2
@mirageman2 Жыл бұрын
Hi, this is the best flyweight explanation i could find on youtube (the other ones were horrible to be honest).
@geekific
@geekific Жыл бұрын
Glad it was helpful!
@nadavshemesh1231
@nadavshemesh1231 7 ай бұрын
I don't know if its intentional or not, but the style of these videos is similar to the Portal 2 aperture science instructional parts (even the voice resembles the voice acting in Portal Stories: Mel). Regardless, I LOVE this style! Thank you.
@ricardovidal6550
@ricardovidal6550 Жыл бұрын
Perfect
@kaanefe4266
@kaanefe4266 2 ай бұрын
God bless you!
@ekathe85
@ekathe85 Жыл бұрын
Nice and very clear! Just one question... does the flyweight pattern contemplate any particular sort of data structure when storing already created flyweights, something like a recursive tree?
@geekific
@geekific Жыл бұрын
Happy to be of help! It depends on your use-case, however, Maps are the most popular because of the ability to retrieve an object in constant time by value :)
@elmatador5459
@elmatador5459 Жыл бұрын
Hey ! Great explanations, thanks ! In the bookfactory, why do you only compare the type and not all the intrinsic values? If I understand correctly, there will be only once the type "action" and once the type "Fantasy" without caring about the different distributors and otherdatas. Thanks for your answer.
@geekific
@geekific Жыл бұрын
A better name for it would be BookTypeFactory I guess! Sorry for the confusion :) And we are doing that because the attributes stored inside the Type are what is being repeated between books, the others may vary. Hope this helps!
@elmatador5459
@elmatador5459 Жыл бұрын
@@geekific Thank you for your answer and especially the quality of your video !
@yotamarker
@yotamarker 6 ай бұрын
please do a video about the livingrimoire AGI software design pattern
@atharv9924
@atharv9924 Жыл бұрын
I thought I understood from the video but when I saw your implementation code in github it doesn't match to the class diagram in video. This leads to more confusion. For example there is no 'Store' class in video and in 'Book' and 'BookType' class there are no methods as shown in video, could you please explain? Also, 'BookType' which is in 'BookFactory' class but not imported, not sure how the code even compiled in the first place? Though appreciate your efforts to explain the concept easily! Thanks.
@geekific
@geekific Жыл бұрын
Glad I could help! - There is a store class in the GitHub repo plz have another look... - There are no methods in the Book and BookType classes in the video as well... - No need to import it because they are in the same package... Cheers!
@atharv9924
@atharv9924 Жыл бұрын
@@geekific Thanks for the response. Let me frame questions well: - What does the 'Store' class represents in classdiagram? - Aren't the 'context' and 'operation' the methods in Book and BookType classes as shown in classdiagram?
@mishaaskar
@mishaaskar 2 ай бұрын
did i just hear cache being pronounced cashue? 3:53
@saitejapln3191
@saitejapln3191 2 ай бұрын
yes
@linuxshell8804
@linuxshell8804 18 күн бұрын
Cashé
@sidekick3rida
@sidekick3rida Жыл бұрын
Thanks! Although, Java is one of the worst languages, especially for explaining computer science concepts.
@geekific
@geekific Жыл бұрын
Glad I could help! Java is very verbose, that is why I actually find it easier to teach stuff with it!
Final muy inesperado 🥹
00:48
Juan De Dios Pantoja
Рет қаралды 18 МЛН
ТАМАЕВ vs ВЕНГАЛБИ. Самая Быстрая BMW M5 vs CLS 63
1:15:39
Асхаб Тамаев
Рет қаралды 4,7 МЛН
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,2 МЛН
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 190 М.
Flyweight Design Pattern in detail | Interview Question
11:33
Daily Code Buffer
Рет қаралды 5 М.
Why didn't the Angular team just use RxJS instead of Signals?
8:15
Joshua Morony
Рет қаралды 86 М.
Final muy inesperado 🥹
00:48
Juan De Dios Pantoja
Рет қаралды 18 МЛН