Spring @Configuration Annotation - What are Proxy Bean Methods?

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ม.ค. 2025

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

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

    Great insight! Even though we cannot make this behaviour default, it *feels* like it should be default. Personally I’m against any “magic” in code. I like things concise and transparent and I don’t mind writing a little more code instead of using the “magic.”

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

    I always wondered about this but didn't dig much. Thanks for making it clear!

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

    The explanation is clear.
    You made a small typing error in the description @Configuration :)
    Thank you for the tutorial !

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

      Sorry for that, thanks for the heads up!

  • @TsimurKatkouski-o3k
    @TsimurKatkouski-o3k 11 หลายเดือนก่อน

    Super clear now. Thank you a lot!

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

    It's really useful information. FYI - Spring uses its own folk of CGLIB within spring-core.

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

    Hello Dan great video like always! Thanks buddy

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

    A nice & concise tutorial.

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

    Thanks for this tutorial Dan

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

    So cool, thanks for the video!
    So, what was the decision to introduce the proxies in the past?
    Is it considered to be a bad practice now?
    What are the situations when we cannot avoid proxies?

  • @Anonymous-zo9qr
    @Anonymous-zo9qr หลายเดือนก่อน

    Hey, could you tell me what's the font and theme you are using for intellij? it looks great!

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

    Thanks for the cool insight!!!. If possible can you come up with @Transactional annotation specially with R2DBC. Thanks once again.

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

    You deserve the thumb up

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

    One thing I don't get - The CGLib proxy installs a wrapper around the conf class, but doesn't modify the class itself (or so we're told in the Spring-AOP documentation, maybe I'm mixing two use cases for CGLib). So when we call restTemplate() from runService(), how does Spring make us go through the proxy (in comparison, the AOP docs specifically indicate that calls from one method of the class to another aren't being proxied)?

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

    thanks! great tutorial. Dan why you don't ever use Lombok in your videos? Is it for a better understanding of what's going on? Or it is bcoz some annotations don't work well with Spring? (IDEA sometimes suggests me avoid @Data for entities)

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

      With Records I don't really have a use for Lombok these days. Also I teach a lot of beginner material and I like to avoid having to point out something else in the middle of a tutorial If I can avoid it.

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

    Maybe proxyBeanMethods should be set to false by default and then give us warning to enable it if we use bean methods inside config class. If in fact it can improve performance....

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

      The problem is we can't just flip that switch because it wouldn't be backwards compatible. I think its good to understand what's going on here and make an informed decision in your code.

  • @Airforce_inter
    @Airforce_inter 10 หลายเดือนก่อน +1

    Why don't u use the intellij itself to initialize an spring boot project? It also adds dependencies automatically. Everything in intelij 🎉

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

      I use start.spring.io because not everyone is using IntelliJ. When I am working on my projects and not recording tutorials I do use it

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

    Thanks, I learned something new. But I noticed that the appearance of IntelliJ is different from the classic, is it a new version or a theme ?

    • @nico-s29
      @nico-s29 2 ปีที่แล้ว +1

      I am not so far into the Video rn but I am very sure you mean the new ui which can be activated in the settings when you use the newest intellij version

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

    Can you make a video where a user cannot view and edit information of another user even when they have same role and authority using spring security and a relational database … I looked at many TH-cam channels but they also haven’t showed it .. Can you please make a video ? Thank you so very much !

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

    How to use MQTT broker publish and subscribe in springboot Java & connection set up ?

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

    Nice tutorial. As you were mentioning of "native..", could you please elaborate what does it mean in the context of this tutorial or where it's applicable ? what does it actually mean, like by flipping flag proxyBeanMethods to false does it mean the "code" would run natively, what does it mean?

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

      I think he is talking about GraalVM Native Image Support, which turns your java application into a natively compiled system executable.

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

    how do you do to have a fancy colored terminal in intellij? mine is just plane black & white :(

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

    Hello sir
    Can you please make video about
    How to send SMS using Java spring boot
    also mention which is community or paid version
    thanks

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

    thank u

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

    gr8

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

    what is your IDE name

    • @nico-s29
      @nico-s29 2 ปีที่แล้ว

      IntelliJ idea ultimate with New ui activated

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

    74th...Thanks Dan

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

    Question about @Bean public methods. Does IntelliJ not offer to remove the public modifier? Both Spring Tool Suite and the OpenRewrite best practices recipe will remove it, for reference:
    org.openrewrite.java.spring.BeanMethodsNotPublic Remove public modifier from @Bean methods. They no longer have to be public visibility to be usable by Spring.