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
This one is really good. Could you please cover the rest of the design patterns? I am used to your videos for interviews :).
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.
Request you to cover rest of the design patterns as well
Sure Veenu 👍👍
@@CodeDecode waiting for it ma'am.
Yes
@@CodeDecodemam please cover remaining patterns....these are very helpful 🙏
Really appreciate your efforts in making all these videos. Thank you so much !!!
Thanks Naveen 🙂🙂👍👍
Thanks a lot for the video, can we expect this series of Structural DP as well as Behavioral DP.
Awesome content. It will be nice if you can share the slide or some notes. Will be quite helpfull. Thanks
Thank you so much for your effort.Please upload videos of Adapter and behavior design pattern
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?
Like all of your explanation using demo. Thank You (y)
Thanks Rishikesh
String constant pool is real time example of Flyweight pattern
Thanks for video 👍👍 you explained it well 👍👍
You are welcome....
For caching which DP should be used Prototype or Proxy ?
Awesome explaination
Thanks
Very nice way explaining ... Keep on making videos✌️.
Thanks for the nice words.....
Appreciate the efforts preparing the content.
But being greedy of knowledge, request to complete this series asap :)
Sure 👍👍
Can we expect behavioural design patterns lecture as well ? Do help when it's possible as your channel is excellent. 👍
Sure Karthikeyan 🙂👍
Nice explanation. Please provide more videos with other structural design patterns
Thanks Sowmiya. we will upload it soon
Awesome Tutorials,Please provide other design Patterns also...
sure we will create it soon
Again very good content again thank from bottom of my heart
Thanks neha for nice words
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.
I have covered playlist on uploaded design patterns . Could you please cover remaining design pattern's as well.
Thanks for this video. Please do more videos on the remaining design patterns.
sure shamil we will try to cover more videos on this
Very nice explanation, waiting remaining design patterns.
Sure 👍👍
Great explanation..Request you to cover rest of the design patterns as well asap
Sure Roopa 👍🙂
Thanks for creating awesome video. if possible please cover rest of the design patterns also
Sure Ankit 👍
Thanks for video it's really help for understanding degine partten,
Can you create video for other type of degine partten.
Hello ma'am, Please create videos on rest of the design patterns of structural, behavioral and J2EE patterns.
Good stuff,keep going on
Thanks 🙏
Please create and upload videos on remaining structural design patterns and later behavioural.
Thanks
Sure 👍
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.
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.
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?
@@CodeDecode Yes I understand when to use it. However, I expected examples like how you explained it for Factory& Abstract Factory Patterns
No worries. Will keep that in mind and will try to simplify more 🙂thanks 👍
Please cover rest of the design pattern. You explains the things very nicely.
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.
@@CodeDecode thank you so much for considering my request.
Thanks for bringing it to our notice Kundan 👍👍
Your Videos are simple to understand. Request you to complete all Design Patterns.
Sure Rajesh. We will do that 🙂👍
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 ?
Sure. 👍
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?
Ma'am thank you, please cover remaing design patterns 🙏
Sure Rudresh 👍🙂
Can we take jwt based authentication as a proxy design pattern
Looking forward for Behavioral Patterns interview questions
Sure 👍👍
excellent explanation please cover remaining design patterns madam
Sure 👍
Great Explanation, please share behavioural design pattern also
Sure 👍
@@CodeDecode please send link or upload if you are not done
Please create video session for Rest of design parreterns like Facade, Decorator, etc..
Sure 👍
Please create more videos on design patterns with scenarios.
th-cam.com/video/JFvSCobD7JU/w-d-xo.html
Please make a video on the Spring data JPA interview question.
Sure. We have videos on hibernate already on channel. do you need link for that?
Hello...requesting you to kindly complete the remaining design patterns.It would be very helpful for us.Thanks
Sure 👍👍
Please share all strutural design pattern whichever left
Sure
Request to please cover rest design patterns as well
Sure Shubhi 👍👍
why you have created CommanShareable as class? why not interface?
Please make videos on Spring interview questions
Sure
Flyweight is focusing on creating object also then why it is categorised as behavioural design pattern rather creational design pattern.
Please also create one video on facade design pattern. If already there please share the link.
Sure Priyanka 👍👍
Requesting you to cover other's too
Sure Akash, we will cover them too
Please add all other design pattern with example
Sure Sunny 🙂👍
I don't see a difference b/w singleton and flyweight patterns except their category.
can you provide code for these
what about remaining 4?
please share rest of dp of structral dp
Sure 🙂👍
Please upload the rest of the design pattern.
Sure 👍👍
Please complete the structural design patterns still 4 are left
Sure
Thanks for this video. Please do more videos on the remaining design patterns.
Sure we will create it soon
Please update if you are done@@CodeDecode