Java Design Pattern Interview Questions & Answers || Proxy & Flyweight Design Pattern [Live Demo]

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มี.ค. 2021
  • Design Pattern Interview Questions || Proxy and Flyweight Design Pattern
    Udemy Course of Code Decode on Microservice k8s AWS CICD link:
    openinapp.co/udemycourse
    Course Description Video :
    yt.openinapp.co/dmjvd
    What are Proxy Design Patterns?
    It’s a Structural design pattern.
    It lets you provide a substitute or placeholder for another object.
    A proxy controls access to the original object, allowing you to perform something either before or after the request gets through to the original object.
    Roles in Proxy Design Pattern?
    Major roles used in this design patterns are :
    Subject - is an interface that exposes the functionality available to be used by the clients.
    Real Subject - is a class implementing Subject and it is the concrete implementation that needs to be hidden behind a proxy.
    Proxy - hides the real object by extending it and clients communicate to the real object via this proxy object. Usually, frameworks create this proxy object when the client request for the real object.
    Advantages of Proxy Design Pattern?
    Access control/protection given by proxy object: This is when you want only specific clients to be able to use the service object.
    Caching request results (caching proxy). This is when you need to cache results of client requests and manage the life cycle of this cache, especially if results are quite large.
    Logging requests (logging proxy). This is when you want to keep a history of requests to the service object.
    What is Flyweight Design Patterns?
    It’s a Structural design pattern.
    A flyweight is a shared object that can be used in multiple contexts simultaneously. The flyweight acts as an independent object in each context.
    Where to use Flyweight DP?
    When your application needs large number of objects that shares most of the common attributes called Intrinsic Attributes or properties and only few unique attributes called as Extrinsic attributes / properties.
    We need to control the memory consumption by large number of objects - by creating fewer objects and sharing them across.
    When to use Flyweight DP?
    The number of Objects to be created by application should be huge.
    The object creation is heavy on memory and it can be time consuming too.
    The object properties can be divided into intrinsic and extrinsic properties, extrinsic properties of an Object should be defined by the client program.
    -------------------------------------------------------------------------------------------------------------------------------------
    Code Decode Playlists
    Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
    Advance Java Interview Questions and Answers : • Advance Java Interview...
    Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
    Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
    Spring Boot Interview Questions and Answers : • Advance Java Interview...
    Angular Playlist : • Angular Course Introdu...
    GIT : • GIT
    -------------------------------------------------------------------------------------------------------------------------------------
    Subscriber and Follow Code Decode
    Subscriber Code Decode : th-cam.com/users/CodeDecode?...
    Linkedin : / codedecodeyoutube
    Instagram : / codedecode25
    --------------------------------------------------------------------------------------------------------------------------------------
    #designpattern #flyweightdesignpattern #proxydesignpattern

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

  • @priyankachougule4334
    @priyankachougule4334 3 ปีที่แล้ว +8

    This one is really good. Could you please cover the rest of the design patterns? I am used to your videos for interviews :).

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

    finally, I have confidence in the design pattern thanks for making such kind of video you are one of the best tutors. please make some video real-time scenarios based on a question on the real-time project.

  • @veena618
    @veena618 3 ปีที่แล้ว +20

    Request you to cover rest of the design patterns as well

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

      Sure Veenu 👍👍

    • @alphazero0
      @alphazero0 2 ปีที่แล้ว

      @@CodeDecode waiting for it ma'am.

    • @NoName-yr2nc
      @NoName-yr2nc 2 ปีที่แล้ว

      Yes

    • @PoojaYadav-wy6fg
      @PoojaYadav-wy6fg 19 วันที่ผ่านมา

      ​@@CodeDecodemam please cover remaining patterns....these are very helpful 🙏

  • @naveenkellaka
    @naveenkellaka 2 ปีที่แล้ว +3

    Really appreciate your efforts in making all these videos. Thank you so much !!!

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Thanks Naveen 🙂🙂👍👍

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

    Thanks a lot for the video, can we expect this series of Structural DP as well as Behavioral DP.

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

    Awesome content. It will be nice if you can share the slide or some notes. Will be quite helpfull. Thanks

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

    Thank you so much for your effort.Please upload videos of Adapter and behavior design pattern

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

    Thanks Really Great Content , helpful playlist for LLD interview Preparation. One doubt The Proxy Design pattern is similar to what we used to follow interceptor concept in any spring applications where we sometimes need to validate and give access to which user role the appropriate endpoint should be exposed?

  • @rishikeshsawant9249
    @rishikeshsawant9249 2 ปีที่แล้ว +2

    Like all of your explanation using demo. Thank You (y)

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

      Thanks Rishikesh

  • @siddha07
    @siddha07 2 ปีที่แล้ว +2

    String constant pool is real time example of Flyweight pattern

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

    Thanks for video 👍👍 you explained it well 👍👍

    • @CodeDecode
      @CodeDecode  3 ปีที่แล้ว

      You are welcome....

  • @thishandle123
    @thishandle123 2 ปีที่แล้ว

    For caching which DP should be used Prototype or Proxy ?

  • @maankhurana5814
    @maankhurana5814 18 วันที่ผ่านมา +2

    Awesome explaination

    • @CodeDecode
      @CodeDecode  17 วันที่ผ่านมา

      Thanks

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

    Very nice way explaining ... Keep on making videos✌️.

    • @CodeDecode
      @CodeDecode  3 ปีที่แล้ว

      Thanks for the nice words.....

  • @AbhishekVerma-zg4ov
    @AbhishekVerma-zg4ov 3 ปีที่แล้ว +2

    Appreciate the efforts preparing the content.
    But being greedy of knowledge, request to complete this series asap :)

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

    Can we expect behavioural design patterns lecture as well ? Do help when it's possible as your channel is excellent. 👍

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว +2

      Sure Karthikeyan 🙂👍

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

    Nice explanation. Please provide more videos with other structural design patterns

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Thanks Sowmiya. we will upload it soon

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

    Awesome Tutorials,Please provide other design Patterns also...

    • @CodeDecode
      @CodeDecode  3 ปีที่แล้ว

      sure we will create it soon

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

    Again very good content again thank from bottom of my heart

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Thanks neha for nice words

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

    mam if we create an interface and put member variables they will be static and final right ? So if they are static they are sharable across it's child classes and then what is the purpose of flyweight design pattern? we could simply make the class implement an base interface and keep these variables there and they will work just like the flyweight design pattern.

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

    I have covered playlist on uploaded design patterns . Could you please cover remaining design pattern's as well.

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

    Thanks for this video. Please do more videos on the remaining design patterns.

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      sure shamil we will try to cover more videos on this

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

    Very nice explanation, waiting remaining design patterns.

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

    Great explanation..Request you to cover rest of the design patterns as well asap

    • @CodeDecode
      @CodeDecode  3 ปีที่แล้ว

      Sure Roopa 👍🙂

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

    Thanks for creating awesome video. if possible please cover rest of the design patterns also

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

      Sure Ankit 👍

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

    Thanks for video it's really help for understanding degine partten,
    Can you create video for other type of degine partten.

  • @nehagoelagrawal8007
    @nehagoelagrawal8007 2 ปีที่แล้ว

    Hello ma'am, Please create videos on rest of the design patterns of structural, behavioral and J2EE patterns.

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

    Good stuff,keep going on

  • @kailashpatil1300
    @kailashpatil1300 2 ปีที่แล้ว +2

    Please create and upload videos on remaining structural design patterns and later behavioural.
    Thanks

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

    Thanks for putting a lot of effort to make these design patterns easily understandable. Hope I will see other Design Patten videos soon and PLease explain these pattens with real-time examples.

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

      Yes will try to upload them soon. As we proceed the complexity of these design patterns increases. Hence it takes a bit long time to make it understandable. Thanks for bearing with us.

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

      Real time scenerios are already covered during the video . As in when u have large no of objects having more common things, use flyweight and if u have some object to be accessed only after security checks and auths then use proxy. These are real time situations only. What else you want me to cover?

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

      @@CodeDecode Yes I understand when to use it. However, I expected examples like how you explained it for Factory& Abstract Factory Patterns

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

      No worries. Will keep that in mind and will try to simplify more 🙂thanks 👍

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

    Please cover rest of the design pattern. You explains the things very nicely.

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

      Sure Kundan. We will create rest of them soon. We didn't get response on design pattern from subscribers, hence we have moved on to spring boot, multi threading and spring security. Once we are done with them, we will get back top design patterns.

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

      @@CodeDecode thank you so much for considering my request.

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

      Thanks for bringing it to our notice Kundan 👍👍

  • @RajeshKumar-io9hl
    @RajeshKumar-io9hl 2 ปีที่แล้ว +1

    Your Videos are simple to understand. Request you to complete all Design Patterns.

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure Rajesh. We will do that 🙂👍

  • @bhavukarora2953
    @bhavukarora2953 3 ปีที่แล้ว +3

    Your content is good. Please complete this series of Structural DP as well as Behavioral DP. Also wanted to say that you missed "Bridge DP" which is a part of Structural DP any specific reason for that ?

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

    Hi Madam, I have one doubt, Suppose if we want to prevent client to directly create object for real class in proxy pattern, how to achieve?

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

    Ma'am thank you, please cover remaing design patterns 🙏

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

      Sure Rudresh 👍🙂

  • @tejachowdary309
    @tejachowdary309 2 ปีที่แล้ว

    Can we take jwt based authentication as a proxy design pattern

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

    Looking forward for Behavioral Patterns interview questions

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

    excellent explanation please cover remaining design patterns madam

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

    Great Explanation, please share behavioural design pattern also

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure 👍

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

      ​@@CodeDecode please send link or upload if you are not done

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

    Please create video session for Rest of design parreterns like Facade, Decorator, etc..

  • @NoName-yr2nc
    @NoName-yr2nc 2 ปีที่แล้ว +1

    Please create more videos on design patterns with scenarios.

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      th-cam.com/video/JFvSCobD7JU/w-d-xo.html

  • @ImranShaikh-tg7hy
    @ImranShaikh-tg7hy 3 ปีที่แล้ว +1

    Please make a video on the Spring data JPA interview question.

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

      Sure. We have videos on hibernate already on channel. do you need link for that?

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

    Hello...requesting you to kindly complete the remaining design patterns.It would be very helpful for us.Thanks

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

    Please share all strutural design pattern whichever left

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

      Sure

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

    Request to please cover rest design patterns as well

    • @CodeDecode
      @CodeDecode  3 ปีที่แล้ว

      Sure Shubhi 👍👍

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

    why you have created CommanShareable as class? why not interface?

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

    Please make videos on Spring interview questions

  • @cookies4techies992
    @cookies4techies992 2 ปีที่แล้ว

    Flyweight is focusing on creating object also then why it is categorised as behavioural design pattern rather creational design pattern.

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

    Please also create one video on facade design pattern. If already there please share the link.

    • @CodeDecode
      @CodeDecode  3 ปีที่แล้ว

      Sure Priyanka 👍👍

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

    Requesting you to cover other's too

    • @CodeDecode
      @CodeDecode  3 ปีที่แล้ว

      Sure Akash, we will cover them too

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

    Please add all other design pattern with example

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure Sunny 🙂👍

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

    I don't see a difference b/w singleton and flyweight patterns except their category.

  • @siddardhreddy931
    @siddardhreddy931 3 ปีที่แล้ว

    can you provide code for these

  • @vinayuddagiri
    @vinayuddagiri 2 ปีที่แล้ว

    what about remaining 4?

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

    please share rest of dp of structral dp

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

    Please upload the rest of the design pattern.

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

    Please complete the structural design patterns still 4 are left

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

      Sure

  • @lotsInMusic
    @lotsInMusic 11 หลายเดือนก่อน +1

    Thanks for this video. Please do more videos on the remaining design patterns.

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

      Sure we will create it soon

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

      Please update if you are done​@@CodeDecode