what a lovely video it's really nice to get inspired from these types of videos... your videos really helping me to develop large projects and making them easier to maintain, thanks to the algorithm for recommending me this video got a single question here about the proxy approach so in testing why we would use proxy object if we were going to test all the functionality of the object is it a temporary approach for this case so we can test some of the functionality and leave the rest later but I would not do that for the sake of seeing a compile error and handling it the way I want
Thanks for your kind words. In testing we might use a proxy in place of a production object because it is easier to set up, or doesn’t launch missiles or somesuch - these are mock objects. In a couple of episodes’ time I think we will use a proxy that just slows down requests to the InMemoryCustomers in order to help test throughput. There are lots of places where we might want to augment existing functionality - see the decorator pattern.
Nice! Inspired an entire afternoon of hacking around with proxy objects. Just wondering why you looked up the method on `this.java.class` rather than directly invoking the method that was passed to the invocation handler? It _seems_ to work the same for the scrappy one I've tested... but maybe I'm missing something?
@@PairingWithDuncan Right - that makes sense - and because we were faking the structural subtyping you needed to look up the method from one interface into the other interface. Makes sense now!
Wow, that’s a bit extreme. Even if you would rather be writing something else, without Java there would be no JetBrains or Kotlin! Personally I find the language itself to be frustrating these days, but the JVM is an amazing technology and often the right tool for the job.
I also don't use Java anymore, but it's a bit daft to diss it so much. If it was that bad it wouldn't have been the biggest language in the world for fifteen years. Duncan, how's it going? We used to work together at Sony with Richard Care. Jim Morrison. Great channel by the way.
what a lovely video
it's really nice to get inspired from these types of videos...
your videos really helping me to develop large projects and making them easier to maintain, thanks to the algorithm for recommending me this video
got a single question here about the proxy approach
so in testing why we would use proxy object if we were going to test all the functionality of the object
is it a temporary approach for this case so we can test some of the functionality and leave the rest later
but I would not do that for the sake of seeing a compile error and handling it the way I want
Thanks for your kind words. In testing we might use a proxy in place of a production object because it is easier to set up, or doesn’t launch missiles or somesuch - these are mock objects. In a couple of episodes’ time I think we will use a proxy that just slows down requests to the InMemoryCustomers in order to help test throughput. There are lots of places where we might want to augment existing functionality - see the decorator pattern.
Nice! Inspired an entire afternoon of hacking around with proxy objects. Just wondering why you looked up the method on `this.java.class` rather than directly invoking the method that was passed to the invocation handler? It _seems_ to work the same for the scrappy one I've tested... but maybe I'm missing something?
You can get away with the one passed to the invocation handler if your wrapped object implements the interface, but not otherwise?
@@PairingWithDuncan Right - that makes sense - and because we were faking the structural subtyping you needed to look up the method from one interface into the other interface. Makes sense now!
Next week's video shows that sometimes we have to look harder, down the back of the sofa, inside shoes, all sorts of places.
Java has caused so much pain, suffering, and damage to the entire industry. I'd rather be writing COBOL or punch cards.
Wow, that’s a bit extreme. Even if you would rather be writing something else, without Java there would be no JetBrains or Kotlin!
Personally I find the language itself to be frustrating these days, but the JVM is an amazing technology and often the right tool for the job.
I also don't use Java anymore, but it's a bit daft to diss it so much. If it was that bad it wouldn't have been the biggest language in the world for fifteen years.
Duncan, how's it going? We used to work together at Sony with Richard Care. Jim Morrison.
Great channel by the way.
@jimmorrison2657 Wow blast from the past! I was, coincidentally, just chatting with Richard when I saw your message.
@@PairingWithDuncan Aha, ok nice one. That's good to hear. All the best!!