Proxy Design Pattern Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ธ.ค. 2024

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

  • @miquelstrippoli2286
    @miquelstrippoli2286 5 หลายเดือนก่อน +2

    2024 and still one of the best tutorial for design patterns.

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

    I will have an exam this week and I have to know a lot of design Patterns, and your tutorials helped me a lot. Great tutorials. Thanks.

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

    almost 10 years later and these are still great!

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

      Thank you very much :)

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

    I'm just very happy that you like them. This stuff translates perfectly into C# I'm sure. I'm glad you have benefited with you VB coding as well :)

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

    Thank you :) Don't worry I'll cover that in detail. I have a bunch of refactoring tutorials planned (that is the fancy name for what you're asking for) It is all coming. Sorry it takes so long, but I don't know any other way to do the tutorials the right way

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

    These videos are timeless. Thank you for putting them up.

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

      Thank you for the great compliment :) Happy I could help

  • @derekbanas
    @derekbanas  11 ปีที่แล้ว

    To understand all of this, it is probably best to watch the first 2 parts of my Object Oriented Design tutorial. th-cam.com/video/fJW65Wo7IHI/w-d-xo.html
    After that I bet everything makes much more sense because I show a real world example from start to finish on how OOP actually works

  • @derekbanas
    @derekbanas  11 ปีที่แล้ว

    I should have created code that took full advantage of the pattern, but I came up with this example to keep everything as simple as possible. I'll revisit patterns in the future and try to create better examples.

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

    Thank you so much for these beautiful videos. Financial help provides relief from problems temporarily but education provides relief from all problems forever. you are doing great service. Wish all universities provide free education

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

    Hello, I definitely have tutorials on networking planned and I'll get to them ASAP

  • @aniketvp
    @aniketvp 10 ปีที่แล้ว +23

    Hey, the ATMProxy class constructs a new ATMMachine and returns its field values. How does this help if you need the values of fields from the realATMMachine?

    • @JG-po2db
      @JG-po2db 7 ปีที่แล้ว +21

      it doesn't, this is an awful example

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

      oh god... thanks Jesse, i was banging my head feeling like i am a fucking moron for not seeing how it helps at all....

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

      ​@@beepIL Even I was a bit confused and realised that's the problem with academic tutorials. I am searching for the real world example.😂😂😂

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

    Thank you :) I'm going to cover hibernate and spring very soon. Thank you for the request

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

    easiest to understand explanation on the interwebs. :) Thank you!

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

      You're welcome :) Glad I could help

  • @derekbanas
    @derekbanas  11 ปีที่แล้ว

    I add comments and sometimes make minor changes if I think it will make the code easier to understand. The videos are normally improved, so if I can help the learning process with a few touch ups I do it. I hope that makes sense

  • @derekbanas
    @derekbanas  12 ปีที่แล้ว

    Eres rápido! No hay de qué. Tenga un fin de semana bendecido, así

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

    You're the man SawMan :)

  • @derekbanas
    @derekbanas  12 ปีที่แล้ว

    Thank you :) I'm sorry, but I'm not sure what your question is. Feel free to send me a message in TH-cam if you need more space to explain what is confusing. I'll do my best to help

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

    You're very welcome :) Im glad they helped

  • @mo5168
    @mo5168 8 ปีที่แล้ว +14

    if you use an object of interface type, which is apparantly doing the job of the proxy which is to limit access to methods, what is the use for the proxy object then?
    great video by the way :-)

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

      You could cast the interface variable to underlying concrete class and get access to all the methods:
      GetATMData realATMMachine = new ATMMachine();
      ((ATMMachine)realATMMachine).getSecret();

    • @ForgottenKnight1
      @ForgottenKnight1 7 ปีที่แล้ว

      you'd render the interface useless then. it is also bad practice. If you need to call a method, in your proxy, it should be part of your contract. if you need to do an authorized call, add a verification of permission step before creating the real object to perform the call on, else perform the call on the proxy, rendering a default result. The role of the proxy is to do pre and post actual operation execution on the real client and provide default implementations if some logic is not met in order to create the real subject for request execution.

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

      @@ForgottenKnight1 I was thinking about the same think. I believe use cases for most of these patterns are not explained correctly. I think the real use case of the proxy is to do post and pre operations. You can access the real class implementation through reflection anyways so proxy is not secure at all.

  • @ashishcheema
    @ashishcheema 11 ปีที่แล้ว

    Awesome Derek.. :).. Best part in the presentation is its clear, crisp and to the point.. and most importantly touching right cells in my brain :)

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

    Hi Derek--- I understand the desire for simplicity. I was expected that proxy would have a composition relationship with the actual ATMMachine and the proxy would only expose the two methods. What are your thoughts?

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

    You are aware that not all the code is available? ATMMachine class has only the new stuff and not any of the stuff from the State Design pattern. And several classes are missing once I fix ATMMachine class. These tutorials are supposed to be self-contained, yes? Besides, that it was a great tutorial. Especially, being able to restrict access to methods of ATMMachine by implementing an GetATMData interface. Pretty elegant.

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

    I used bind a lot in part 3 of my JQuery tutorial and others after it. I didn't cover live or delegate though

  • @derekbanas
    @derekbanas  12 ปีที่แล้ว

    These videos focus on teaching the patterns. I'm sorry, but the code isn't normally real world ready without some experimenting. I'm looking at patterns further in my refactoring tutorial. I'll be making real world applications with these patterns soon. I hope that makes sense

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

    Hi Derek, Great videos, thanks!
    I have a question about the Proxy tutorial, i didn't actually understand
    way in the ATMproxy class you creates a new ATMmachine object inside the methods,
    It will provides you the same results anytime (for example cash=2000).

  • @Stefanfritzon
    @Stefanfritzon 9 ปีที่แล้ว +15

    In the proxy class methods you use new() comando. Dosen't this just give you an new reference to an new object on an machine. in other words you always get start value of the machine?

    • @Josh-wm6wf
      @Josh-wm6wf 9 ปีที่แล้ว +6

      ***** I was thinking the same. I think he meant to use a private static variable of ATM machine to keep the instance. Or perhaps he meant to update the data in a different way. Either way I agree, it will return only the default values

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

      ***** I totally see it the same as you do. It would make sense to keep it in the constructor like Proxy = new ATMProxy(ATMMachine) but wouldn't that be the facade pattern iirc?

    • @sandykhp
      @sandykhp 6 ปีที่แล้ว

      +Josh Ii think there is something more to this pattern than what is visible. If you notice he mentions that the proxy creates and destroys objects inside it.

    • @kareemjeiroudi1964
      @kareemjeiroudi1964 4 ปีที่แล้ว

      Agree. He's creating two different objects in each getMachineData() and getCash(). Instead, he should reference the same instance variable in both of them. This instance variable ATMMachine is instantiated only then when needed. I would agree that that wasn't representative of the Proxy pattern.

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

      ​@@kareemjeiroudi1964 He can't do that. How can anyone who is using a Proxy service have access to a real object? If has, he would rather use that. This is not an appropriate example. I found here a better example. Though the process of creating a proxy is correct. th-cam.com/video/TS5i-uPXLs8/w-d-xo.htmlsi=aoo_bS3DISnJvHdd

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

    Hey Derek! Within your ATMProxy class, why do you instantiate a new ATMMachine on every method call? Wouldn't it be more efficient to have it as an instance variable and just access it within each method?

  • @nafeeskhan8249
    @nafeeskhan8249 6 ปีที่แล้ว

    Very nice explanation of proxy pattern that how to show and hide information of real system from remote requests.

  • @baluakshay
    @baluakshay 10 ปีที่แล้ว

    Thanks for posting this Derek. Simple and clear.

    • @derekbanas
      @derekbanas  10 ปีที่แล้ว

      You are very welcome :)

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

    Está muito bem-vindos :)

  • @xxyerodxx
    @xxyerodxx 8 ปีที่แล้ว

    I love your videos, explained short and clearly!
    Keep this Derek :)

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

    You're very welcome :)

  • @charbaugh22
    @charbaugh22 11 ปีที่แล้ว

    Derek, thank you for this simple tutorial.

  • @Calm_Energy
    @Calm_Energy 6 ปีที่แล้ว

    I'm trying to wrap my mind around why creating a proxy will create greater security? Is there maybe an eli5 to answer this? My best guess is if someone hacks into a proxy and starts poking around, if they don't realize it's a proxy then they'll just figure the data that's within the proxy isn't important or useful enough to work with and so will move on to another target?

  • @tanveerkit
    @tanveerkit 8 ปีที่แล้ว

    It is good to follow good coding practice.
    When you define interface name , it should be preceded by letter 'I' that would help to differentiate an interface from a class.
    Anyway , I want to thank you for the knowledge sharing.
    and i clicked on the like button too :)

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

    Hey Derek, Appreciate your efforts and thanks for making such informative and easy to understand video!
    I have a comment, I think that this example is not utilizing the proxy pattern correctly. When we create the object using the Interface, it can utilize the behavior of that interface only. If there is any behavioral change happening in the proxy class which provides the original class a kind of security for example, then it makes sense to use the proxy class. Correct me, if I'm wrong!(P.S. This is new to me.)

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

      I've just watched this video and I noticed that as well. His implementation is not right. He should have added a second part to this video where the state of the ATM machine is altered (by some person) and the proxy still works as expected. He would have then made the right changes to his code.

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

    Hi, Derek. Great tutorials and thanks so much for doing them. I'm working through the playlist. A request if you think it would be worthwhile: a comparison of when you would use one design pattern vs. another? I understand for example that, conceptually, the Bridge is structural and the Strategy pattern is behavioral, but how do we really think through that in a real world example? (I think I understand when you would use each of those, but I'm using those as an example.) Thanks!

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

    So wait i dont get it,
    in order to create atm proxy we basically need to create real atm machine (inside the proxy)
    now for that to happen it means the code needs to KNOW real atm class to begin with.
    so if we can create atm proxy instance, we can create real atm machine instance in whatever code we work,
    then we would simply access whatever we want from the real atm and simply ignore the proxy...
    how is this really limiting someone? what forces someone to work only with the proxy? what prevents them from just creating real atm machine instance and using that, so what is exactly limiting this "outside program" from doing just that?

  • @Didi-bz6kt
    @Didi-bz6kt 4 ปีที่แล้ว

    I think this is more a type of "Protection Proxy"? It is important to point out that we have different type of proxy implementation : Remote Proxy, Virtual Proxy, Copy-onWrite Proxy , Protection Proxy , Cache Proxy , firewall Proxy , Synchronization Proxy , Smart Reference Proxy.

  • @anandsridharan6182
    @anandsridharan6182 9 ปีที่แล้ว

    Derek Thank you for this service you have provided by giving detailed implementations for these design patterns. Need some help with this one pattern. The realATMMAchine that is created in the TestATMMAchine is not used inside the ATMProxy? Instead ATMProxy uses its own newly generated copy. How do I reconsile this?

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

    If anyone is having problems with this, when you create the project, use all the java files from the State Design Pattern as a base to work with. The Code in the link above doesn't all the files you will need.

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

    Hello, Derek! I have some kind of request for you: can you show how to implement proxy for remote access? For example client-server. May be remote weather station on one side and client that can get temperature remotely via network on another.

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

    I have a question. I understand that you created an interface (GetATMData) and you created the concrete classes (ATMMachine and ATMProxy) for that interface so why don't you use ATMMachine rather than ATMProxy. ATMMachine is still restricted by the interface when instantiated by the object realMachine. Example: you could do realMachine.getATMState() or atmProxy.geATMState().

  • @Brax1982
    @Brax1982 9 ปีที่แล้ว +22

    Automatic Teller Machine Machine

  • @filipghimpeteanu2880
    @filipghimpeteanu2880 8 ปีที่แล้ว

    Great work Derek!

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว

      +Filip Ghimpeteanu Thank you :)

  • @hbladeh
    @hbladeh 6 ปีที่แล้ว

    Nice, but 2 questions Derek:
    - In the ATMProxy.java file is it a good idea to use a private field with ATMMachine and not creating it over and over again?
    - If you can access the "non-secret" methods only from the realATMMachine object, why make the proxy? Isn't the interface the proxy itself?

  • @שריאייזנבך-ד1ה
    @שריאייזנבך-ד1ה 10 ปีที่แล้ว +1

    Hi, thanks a lot for this awesome tutorial.
    Can you please explain to me how do I make ATMMachine unaccessible?
    because I understand that right now it is accessible just as much as ATMproxy.

  • @tanvipatel7911
    @tanvipatel7911 8 ปีที่แล้ว

    Thanks Derek! Amazing tutorials. Thanks for all the efforts :)

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว

      Thank you :) I'm happy to help

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

    I do my best :)

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

    In wich way could I protect one class with a proxy, if that class could be instantiated directy?

  • @ttenodi
    @ttenodi 10 ปีที่แล้ว +7

    The problem with giving so simple examples is that no one actually sees the benefit of using Proxy.

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

      ***** Yes I agree, but I felt that making an understandable tutorial would be useful. Then with that knowledge they could move on to the GOF book for more complex examples.

    • @beepIL
      @beepIL 7 ปีที่แล้ว

      It is perfectly understandable, ie - the example is perfectly understandable, but how is this used or what is the benefit of using proxy is now completely lost on me...
      yes i understand the example, not the design pattern :\

    • @ronborneo1975
      @ronborneo1975 7 ปีที่แล้ว

      There's plenty of resources in the internet to dive deeper. I believe Derek is just trying to give us a clear introduction to the design pattern.

    • @beepIL
      @beepIL 7 ปีที่แล้ว

      I am in the internet, and i am diving into examples, its how i ended up on this video to begin with, i merely criticized this example i came across, no one assumes a person wont understand and stop dead in his tracks, of course i looked for other examples as well.

    • @ethanyang5265
      @ethanyang5265 7 ปีที่แล้ว

      Well, I am a bit confused.
      If you don't want others to have access to setATMData(), why don't you just make it a private function?

  • @alkmin
    @alkmin 9 ปีที่แล้ว

    Thank you! It's an amazing tutorial!

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

      +João Neves Your welcome :) Thank you

  • @accountnick
    @accountnick 12 ปีที่แล้ว

    Nice video as usual. Derek, can you do a Java - Hibernate Annotations tutorial? I wanna learn but I'm kinda stucked. Thanks!

  • @ani2595
    @ani2595 10 ปีที่แล้ว

    Hi Derek I hope this is not a bad question to ask. I was wondering what is the point of making the realAtMachine when you have already created methods to get information from the ATMMachine class within the proxy. It can work without the realAtMachine right?

    • @derekbanas
      @derekbanas  10 ปีที่แล้ว

      Anirudh Upadhyayula There are no bad questions. Yes you could do what you said. In trying to make the pattern easy to understand I some times don't use the pattern to its full capabilities. Often to show what makes the pattern great would require a very complex example.

  • @rikrishshrestha5421
    @rikrishshrestha5421 6 ปีที่แล้ว

    "Adawise till next time" ; nice statement to end a video !

  • @leseulsteve
    @leseulsteve 10 ปีที่แล้ว

    Hi! Thanks a lot for your patterns videos, we don't get to learn those thing in my programmer formation... :)
    I was playing with your classes from that exemple and I'm wondering why we need the proxy class when we can just use an ATMMachine like that: GetATMDataManager ATMMachine = new ATMMachine(); ?

    • @derekbanas
      @derekbanas  10 ปีที่แล้ว

      You're very welcome :) To try and keep everything understandable I choose to keep the example simple even if it didn't necessarily require a pattern to optimize the code. Sorry if that was confusing.

    • @leseulsteve
      @leseulsteve 10 ปีที่แล้ว

      It's not confusing at all, I've never been so enlightened since I started my programing clases :)

    • @derekbanas
      @derekbanas  10 ปีที่แล้ว

      Steve Boisvert Thank you :) I'm very happy that I could help. My refactoring tutorial should be very interesting if you have found these useful.

  • @zlatkozeco7951
    @zlatkozeco7951 6 ปีที่แล้ว

    Wow! This is a great tutorial

  • @nikolaikalashnikov4253
    @nikolaikalashnikov4253 10 ปีที่แล้ว

    I have a Maven multi-module project with three layers: (3) The Main class that depends upon (2) The middle layer which depends on (1) The API layer (utilities, etc).
    Normally, the middle layer cannot access the Main class (because you can't have circular dependencies)... In order to get around this, I had the Main class implement an interface declared in the first api layer.
    Would this be an example of a Proxy ? Or another design pattern ? Or did I just hack it together and it's not even a design pattern at all ? Thanks!

  • @NickAskew
    @NickAskew 9 ปีที่แล้ว

    I'm getting into these design patterns way too late. I hope my ramblings make some sense.
    If the purpose of the proxy is, in this case, for security then clearly it should not be possible for the same client to create an instance of ATMMachine. Now if ATMMachine implements the interface GetATMData surely that is enough, you don't add anything with the proxy class.
    I suppose a more useful real world implementation would be a web service that uses authorisation and implements the methods ATMMachine and another web service that does not require authorisation that implements GetATMData. However this being the case I'd also not quite see the purpose of the proxy pattern in this case.
    I suppose actually what this example would benefit from would be if it combined one of the builder patterns. Perhaps a Factory would be used to prevent clients creating instances of the ATMMachine. The Factory could then use some kind of authorisation (being a .Net guy myself that should the straightforward and I'm sure Java has something similar) and allow certain clients to create ATMMachine while everyone can create GetATMData. However even then this would not be a proxy.

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

      +Nick Askew At first I also agreed with the fact that the proxy class actually doesn't add anything, and actually made this video a bit confusing for me at first... but after thinking a bit, the proxy class could definitely add something, because the GetATMData realAtmMachine = new ATMMachine() could be casted to (ATMMachine) realAtmMachine, which would nullify the prevention of the usage of the setters and such.
      Of course, I'm not entirely sure, but I think that that is the only logical way why the proxy class would be placed there. but all in all it's hard to say, there's not enough depth in this kind of code to see a real good use of it I guess.

  • @volkan1534
    @volkan1534 7 ปีที่แล้ว

    If I have two different classes that use the same interface and I want to secure both with my Proxy-Class, do I need in this case two Proxy-Classes or is one enogh for both?

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

    Hi Derek,
    Can you please explain what is the right way of passing the original obejct to the proxy object? In the video it is not clear . snag.gy/biaUoG.jpg . Instead of passing the instance of real object , you are just creating a new object in every call to your proxy methods .

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

      I notice the same, i think you must use composition geting the instace through the constructor

  • @viditadaga3445
    @viditadaga3445 5 ปีที่แล้ว

    Have been following your videos. But this one is confusing since it creates a new instance of real machine every time. Is this correct ?

  • @MrStylesp9
    @MrStylesp9 11 ปีที่แล้ว

    Hey Derek, can you recommend a book that teaches java programming well and is very easy to understand?

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

      Head First Java is very good

    • @MrStylesp9
      @MrStylesp9 11 ปีที่แล้ว

      Derek Banas thank you for replying. Do you know any books for C++ as well?

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

      Styles P'yall C++ Primer Plus

    • @MrStylesp9
      @MrStylesp9 11 ปีที่แล้ว

      Thank you!

  • @ayoubfalah8531
    @ayoubfalah8531 8 ปีที่แล้ว

    Hello Derek Banas,
    Thank you first for the great toturial. I have a question about the main idea behind the proxy design pattern. Let M be a set of methods defined in the protected class ATMMachine, and S is a subset of M, with for each element m in S, m should not be accessible outside of the class ATMMachine(S ist the set of secure methods). In this case we can declare the elements of S as private and M \ S (The set of methods that are accessible outside of the ATMMachine) as public. This implies that the secure methods a not visible outside of the class ATMMachine. Does this approach has any limits that we must use the proxy design pattern. If this is the case, then why?
    Thank you in advance!
    Ayoub

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

      I was thinking about the same think. I believe use cases for most of these patterns are not explained correctly.

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

    Show the ATMMachine class properly in the code link given it's Missng few lines of Code.

  • @roronoa_d_law1075
    @roronoa_d_law1075 4 ปีที่แล้ว

    Why did you make AtmMachine implement the interface as well ?

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

    Could you not do a dynamic cast from GetATMData on the real machine to ATMMachine?

  • @praveen_somireddy
    @praveen_somireddy 9 ปีที่แล้ว

    Is Data abstraction and proxy design pattern same? why because data abstraction also limits the functionality of a class to an interface object. then what is the main difference?

  • @yangliu3456
    @yangliu3456 10 ปีที่แล้ว

    Hi Derek, I could not understand why "realATMMachine" cannot access the "secret" variables either. Thanks.

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

      Because realATMMachine reference is of type GetATMData. You can only use methods and fields that are in this interface. If realATMMachine's type is ATMMachine then you can access all visible methods and fields.

  • @ehreut
    @ehreut 12 ปีที่แล้ว

    hi, great videos! thank you very much. i have a question, in this tutorial you are assuming that all instances of ATM Machine are the same because when you ask the proxy to give you some data it creates a new ATM Machine instance. in a normal situation, every instance will have its own characteristics ( the constructor will not be empty), so then what you do? I may have an ATM machine that have been modified and changed since it was constructor, making new one will not give me what I want.

  • @123japanuser
    @123japanuser 12 ปีที่แล้ว

    Hey Coach , did you cover live() , bind() , delegate() in Jquery and closures in Javascript by any chance.
    If yes please share the exact link.
    Thanks for all the self less help.

  • @ehreut
    @ehreut 12 ปีที่แล้ว

    yes it does, thank you very much, i will get to refactoring soon enough :) and thanks for the quick reply!!

  • @test-rj2vl
    @test-rj2vl 9 หลายเดือนก่อน

    You talked how it hide set cash method but you never showed which class exactly had this method.

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

    Hmmm, shouldn't the proxy should be controlling access to a real object, instead of creating a new object everytime? This example is like the bank buying a new ATM machine everytime a branch manager tries to check balance.

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

      I don't like the new object creation also, I'm not sure it's correct, you always get the default values this way.

  • @MaxMartini2510
    @MaxMartini2510 11 ปีที่แล้ว

    Hi! Explain me if U could. I´m kinda new in Patterns. It´s not real world ok, but if that was the case, I wouldn´t just create new ATMMarchines about every method of the interface right? It would get me nowhere, givin me values of forever new objects. Normally it´s used alongside Factory Pattern, for example? Can U give me a real world example?
    Note.: Added you on G+, nice to meet u and congratulations!

  • @abhishekb289
    @abhishekb289 7 ปีที่แล้ว

    love the proxy pattern

  • @justingraf2903
    @justingraf2903 4 ปีที่แล้ว

    You can't access the set methods because there are none?

  • @prasad3673
    @prasad3673 8 ปีที่แล้ว

    can u create proxy (ip) changer soft. that can automatically change the proxy "IP"in given time dynamically and also create proxy chains.. :) plz.... at least algorithm i cant think how to create this .

  • @MrNiceseb
    @MrNiceseb 11 ปีที่แล้ว

    Hi, the code is not the same as what you have shown in the tutorial?

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

    ATMMachine class is public and the methods which are defined in the interface are also public. So how does it prevent an attacker from using ATMMachine instead of the proxy?

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

      Attacker? Code is compiled into a program. Attackers do not write the code. All these are meant for developers to write a code that cannot be misused by other developers, can be shared, extended, tested, etc.

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

    proxy instantiates real object? oh, that's funny

    • @kh_art_craft
      @kh_art_craft 10 ปีที่แล้ว

      yeah, why?

    • @sandykhp
      @sandykhp 6 ปีที่แล้ว

      If you notice he mentions that the proxy creates and destroys lot of objects inside it.

  • @banamali143
    @banamali143 5 ปีที่แล้ว

    Very nice

  • @123japanuser
    @123japanuser 12 ปีที่แล้ว

    Gracias por su ayuda. Tenga un fin de semana bendecido.
    Fastet Finger First .....sixth "GOLD" :)

  • @davidakful
    @davidakful 7 ปีที่แล้ว

    is proxy and dynamic proxy same?

  • @jivanpatil1241
    @jivanpatil1241 8 ปีที่แล้ว

    why can't we use Abstract class instead of Interface ?

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

      You could, but it is considered best to not use them unless you must have a non-abstract method

  • @hopegolestany2590
    @hopegolestany2590 6 ปีที่แล้ว

    Many Thanks!

    • @derekbanas
      @derekbanas  6 ปีที่แล้ว

      I'm happy to help :)

  • @MaxMartini2510
    @MaxMartini2510 11 ปีที่แล้ว

    Thanks! Obrigado!

  • @ForgottenKnight1
    @ForgottenKnight1 7 ปีที่แล้ว

    "Expensive" not "intensive" :d

  • @MusicalSawMen
    @MusicalSawMen 12 ปีที่แล้ว

    Second place !

  • @astonmartin2235
    @astonmartin2235 7 ปีที่แล้ว

    HI