How flyweight pattern helps in memory optimisation | Design Patterns | sudoCODE

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 มิ.ย. 2024
  • Learning system design is not a one time task. It requires regular effort and consistent curiosity to build large scale systems. Moreover, every system has different requirements and meeting them requires expertise and people with varied and specific knowledge. There are a lot of resources to learn through videos. But not everyone enjoys that mode of learning. Instead some people understand things better by reading and thinking on the points put forward by the author. Such people can access these in different ways - blogs, articles and books. We have come up with this video to put light on one such aspect, that is - Low level Design for developing an admit card module for an app that generates admit card for various different universities.
    ------------------------------------------------------------------
    Recommendations
    ------------------------------------------------------------------
    Our full courses on youtube:
    ✒ System Design Primer Course: • System Design Primer C...
    ✒ REST APIs made easy: • REST APIs MADE EASY
    Some paid courses that we recommend:
    ✒Educative.io: bit.ly/3qnW5ku
    ✒Interviewready.io: get.interviewready.io/ (Use coupon code SUDOCODE for extra discount)
    ------------------------------------------------------------------
    About Us
    ------------------------------------------------------------------
    Created and Instructed by:
    Yogita Sharma
    ✒ LinkedIn - / yogita-sharma-83400b55
    ✒ Instagram - / sudo.code1
    ✒ Facebook - / sudo.code
    ✒ Medium - / yogita088
    Post-production(editing, thumbnail etc) managed by:
    CiKi
    ✒ Website: www.ciki.co.in
    ✒ LinkedIn: / 74735937
    Colors and design by:
    Naini Todi
    ✒ LinkedIn - / nainitodi
    Both Arpit and Yogita are software engineers and want to help other software engineers become better by providing high quality and well researched content by adding their creativity and teaching twist.
    ------------------------------------------------------------------
    Join Us
    ------------------------------------------------------------------
    Hangout with sudoCode:
    ✒Discord Server: / discord
    For business:
    ✒Email: sudocode.yogita@gmail.com
    -----------------------------------------------------------------------------------------------------------------------------
    Timestamps:
    00:00 - Introduction and story
    01:36 - Intro to FlyWeight
    02:02 - Code dig in
    04:11 - Class diagram
    04:39 - Code walk through
    06:05 - Pros and Cons
    06:33 Summary

ความคิดเห็น • 50

  • @nagendrapalla4433
    @nagendrapalla4433 ปีที่แล้ว +5

    I went through all the design pattern videos that you created so far. The way you explained each design pattern with an analogy is excellent. I hope you'll create more videos on the remaining design patterns. Thanks for your help to understand these design patterns in a very easy manner.

  • @apiyush
    @apiyush 3 หลายเดือนก่อน +1

    Concise, crisp and easy to understand LLD playlist. Thanks, Yogita!

  • @dhruvsolanki4473
    @dhruvsolanki4473 4 หลายเดือนก่อน +1

    Just completed this LLD playlist and understood everything easily as your explanation is very good. Thank you for sharing with us.

  • @RohitPatil_Tech
    @RohitPatil_Tech 10 หลายเดือนก่อน +3

    Hi Yogita,
    I just now completed your "Low Level Design Primer Course" youtube playlist.
    And I have to say that your explanation and analogies in the videos was simply fabulous. Appreciate the good work your are putting out. Thank you!! 🙂

  • @kudaykanthreddy
    @kudaykanthreddy 2 หลายเดือนก่อน

    Thank you for the LLD playlist and for the amazing series. However, the descriptions of most of the videos are stale or wrong. Can you please look into that as that is causing confusion.

  • @PaulPronabananda
    @PaulPronabananda ปีที่แล้ว +1

    Thanks for the great explanation.
    Code is not available in the description section, please share the code also.

  • @rahulvaish3034
    @rahulvaish3034 9 หลายเดือนก่อน

    Loved it! Thanks for posting this amazing video.

  • @Abhishek-Khelge
    @Abhishek-Khelge ปีที่แล้ว +3

    why did you stopped in this series ?

  • @tesshsu1
    @tesshsu1 ปีที่แล้ว

    Came to this video and so far most easy to understand, tks

  • @simiiv5021
    @simiiv5021 2 หลายเดือนก่อน

    Thank you for the LLD series!

  • @KKKK-pl8yf
    @KKKK-pl8yf 4 หลายเดือนก่อน

    Binge Watched your LLD playlist. Very highly structured content. Loved your way of teaching. Thanks Yogita !!

  • @abhishekjaiswal3673
    @abhishekjaiswal3673 ปีที่แล้ว

    Hi Yogita, Thanks for making such videos. You have explained very well which good examples. Waiting for strategy desing pattern with good example of why we should choose composition over inheritance.

  • @surajsharma-65643
    @surajsharma-65643 ปีที่แล้ว

    The way you explain, its super cool

  • @Abhishek-Khelge
    @Abhishek-Khelge ปีที่แล้ว

    best explanation of all the videos

  • @swatiacharya9073
    @swatiacharya9073 6 หลายเดือนก่อน

    Superb animation

  • @user-fg2iw4yi7q
    @user-fg2iw4yi7q 5 หลายเดือนก่อน +1

    Playlist completed 🎉

  • @gokulsrinivasan8563
    @gokulsrinivasan8563 2 หลายเดือนก่อน

    Kindly cover Adapter, Facade and other patterns . Thanks for all the fruitful content!!😀

  • @ashisranjandey635
    @ashisranjandey635 3 หลายเดือนก่อน

    Awesome awesome awesome. these kind of backstoy and explanation is what gets me motivated. thanks for sharing.

  • @UpendraSingh-qx5uh
    @UpendraSingh-qx5uh 6 หลายเดือนก่อน

    I have one doubt lets assume i have one red ball having radius 10 and now i want to create one another red ball of radius 5 then as we already have red ball so no new Ball will be created on previous ball extrinsic properties will be overridden then how we will have two red ball?

  • @asjjain191183
    @asjjain191183 ปีที่แล้ว

    Thanks for explaining such a complex design pattern in easy way4

    • @sudocode
      @sudocode  ปีที่แล้ว

      Most welcome 😊

  • @aneksingh4496
    @aneksingh4496 ปีที่แล้ว +1

    Your videos contents are very good ... but make it bit slow to digest ... also include live (fast manner )coding would be better

  • @tirunagariuttam
    @tirunagariuttam 7 หลายเดือนก่อน

    how about we make the intrinsic objects as static. That way they remain at class level.

  • @HariShankar-yf8di
    @HariShankar-yf8di ปีที่แล้ว

    please make videos on remaining design patterns

  • @peoplesvoice5145
    @peoplesvoice5145 ปีที่แล้ว +6

    Hello Yogita, with this pattern we are overriding objects which has individual properties right as it is returning same reference per color and url. At end we will have only 3 objects(we may have many reference but all points 3 objects) based on the colors we have defined in that examples. Here I am not able correlate with this examples as we are seeing many balls. Plz correct me if am wrong.

    • @sumanrana4083
      @sumanrana4083 ปีที่แล้ว +4

      I also agree with the above statement. I think there should be one BallType class that should contain only color & URL. And there should be one field ballType(BallType) in Ball class. @sudoCODE

    • @PremKashyap
      @PremKashyap ปีที่แล้ว +1

      @@sumanrana4083 You are absolutely right. It looked buggy. So I wrote the code to verify it.

    • @ambarishhazarnis9531
      @ambarishhazarnis9531 ปีที่แล้ว

      The intrinsic properties are resused from the cache. The Ball object just has pointers to it. Java does the same with its String pool.

    • @PkSam07
      @PkSam07 9 หลายเดือนก่อน

      ​@@ambarishhazarnis9531No. In the for loop we r fetching one of these 3 flyweight objects randomly and then we r updating extrinsic attributes one by one in one of these 3. Now, in the game screen - How come at a time, these 3 objects could have multiple extrinsic values? In that case these 3 object should blink at different coordinate position(in such a type logic).
      I think this loop should be about creating 10 object and after transition (like as per Yogita) there should be 11 = 10 + 1 flyweight where each one will be using flyweight object. Now, How each will use this flyweight object that's confusing?

    • @PkSam07
      @PkSam07 9 หลายเดือนก่อน

      ​@@sumanrana4083Correct! This BallType could be name as FlyweightBall having intrinsic data. And this factory could be FlyweightBallFactory which will return this flyweight object and then in forloop we could create Ball for each loop; setting this flyweightBall having one more field like u mentioned.
      Or else can move this extrinsic data setting as well inside BallFactory and can create complete Ball object inside Factory itself. Thanks!

  • @colinmaharaj
    @colinmaharaj 10 หลายเดือนก่อน

    Interesting, I'm trying to create an automated trading strategy from my knowledge of programming on my little knowledge of trading.

  • @whereisinfinity
    @whereisinfinity 3 หลายเดือนก่อน

    I just finished this LLD series and I can say with utmost confidence that it's absolutely the best among all the available sources online for LLD. Why have you stopped this series? I really hope you continue this awesome series soon. I am sure a lot of us would be willing to pay for your content as well.

    • @sudocode
      @sudocode  3 หลายเดือนก่อน

      Yes I am coming back soon ☺️

    • @whereisinfinity
      @whereisinfinity 3 หลายเดือนก่อน

      @@sudocode Great to hear!

  • @pyjamchap
    @pyjamchap ปีที่แล้ว

    Yogita, 👍 nice job. Keep going. Need command & strategy pattern.

  • @snadeem9448
    @snadeem9448 ปีที่แล้ว

    On point explanation 👍🏻

    • @sudocode
      @sudocode  ปีที่แล้ว

      Glad you liked it

  • @chinnunarra2744
    @chinnunarra2744 ปีที่แล้ว

    Good explanation

    • @sudocode
      @sudocode  ปีที่แล้ว

      Thanks for liking

  • @AhmedIbrahimGhnnam
    @AhmedIbrahimGhnnam หลายเดือนก่อน

    please, how can i find out the codes for facade design pattern and flyweight design pattern??

  • @deepakp2936
    @deepakp2936 ปีที่แล้ว

    Yogita,
    The contents of the video are very good. But I missed seeing you explaining the things. I hope you are doing good.

    • @sudocode
      @sudocode  ปีที่แล้ว +1

      You would see me very soon.

  • @rishiraj2548
    @rishiraj2548 ปีที่แล้ว +1

    Thanks a lot

    • @sudocode
      @sudocode  ปีที่แล้ว +1

      Happy to help

  • @something.mp3184
    @something.mp3184 2 หลายเดือนก่อน

    Ty

  • @ishimweanna7904
    @ishimweanna7904 10 หลายเดือนก่อน

    I can't see source code

  • @ascii8681
    @ascii8681 ปีที่แล้ว

    Can't Inheritance solve the same issue ?

    • @sudocode
      @sudocode  ปีที่แล้ว +1

      No, it would still create new objects which will occupy a lot of memory.

  • @designpathy
    @designpathy 26 วันที่ผ่านมา

    The example you have shared is wrong. Properties that do not change should be part of another class, example : BookType. Using composition add BookType in Ball class.
    Please everyone do not assume everything online is correct, do your analysis as well.