Spring Tips: Spring Plugin

Поделиться
HTML-код
  • Опубликовано: 27 сен 2024
  • Hi, Spring fans! In this installment Josh Long (@starbuxman) looks at the little-known, often-used Spring Plugin project, which supports the strategy pattern

Комментарии • 23

  • @jimmyl9658
    @jimmyl9658 3 года назад +3

    Nice, I have tons of places where I used my own impl of this pattern. This will help refactoring. Thanks!

  • @thelanelim92
    @thelanelim92 3 года назад +2

    Nice one! Gave me idea where I can use it in my project. Some refactoring on the way. Thanks Josh!

  • @philipschikora20
    @philipschikora20 2 года назад

    Very useful. Thank you Josh!

  • @AbduljaleelAdesina
    @AbduljaleelAdesina 3 года назад

    Nice one! I practically enjoyed this.

  • @codecoffee-farsi3392
    @codecoffee-farsi3392 3 года назад

    Just two days ago we tried to use this pattern, but due to not having the idea we did it manually. Thanks.

  • @pockpicket9360
    @pockpicket9360 3 года назад +1

    good tips

  • @孙军斌
    @孙军斌 3 года назад +1

    Good Stuff

  • @dimitrisdrosos245
    @dimitrisdrosos245 2 года назад

    Thank you very usefull!

  • @OutboxThinker1
    @OutboxThinker1 2 года назад

    Very nice, now time to refactoring 😂

  • @mrrishiraj88
    @mrrishiraj88 3 года назад +1

    Good Day

  • @omkar.at.office
    @omkar.at.office 3 года назад

    nice one!

  • @digitech1241
    @digitech1241 Год назад

    Thank you very much, can I package these plugins in separate jars?

  • @AntonyOmeri
    @AntonyOmeri 2 года назад +1

    Hi @joshLong Is there a way of deploying the plugins while the application is already running without restarting? I can't find proper documentation, I really need to use this

  • @julianruppel9171
    @julianruppel9171 3 года назад +3

    I don’t get the different to having multiple components that implement the same interface and then just autowireing the interface type as a map with the bean name as key or using qualifier annotation ?

    • @ChrisB_Crisps
      @ChrisB_Crisps 2 года назад

      @Julian Ruppel one of the main points of this library is that it comes with an interface that allows to model if a bean supports the operation. How would you choose the supporting beans in the map in your example? By storing a set of classes? The library also works when the support overlaps for different plugin, example with a registry of 3 plugins, it can be that the 1 plugin supports working and handling modes A,B,C,D. the 2nd plugin supports modes B,C,D and a third plugin supports only E. The library comes handy and helps in complex scenarios should it be your case :)

  • @delberthjulensbeti515
    @delberthjulensbeti515 2 года назад +2

    I was wrong the entire time.
    I saw this in one of the spring source and have been doing this pattern in my codes for a long time, but I name it with "Factory" prefix instead of "Strategy", as I thought this is a Factory Pattern.
    Man, I have no idea what I'm doing lol.

    • @ChrisB_Crisps
      @ChrisB_Crisps 2 года назад

      Could be that you are using a factory to create the concrete strategies. It is common to have a factory method pattern and strategy pattern together.

  • @NikiStarGamer
    @NikiStarGamer 3 года назад

    What Is differece between plugin and make manually? Wha is extra or advantage? It's become probably a complex code using a dependency.

  • @Decent1991
    @Decent1991 3 года назад

    Thank you Josh! Explanation is precise and to the point 😀

  • @RajaAnbazhagan
    @RajaAnbazhagan 3 года назад +2

    Hey Josh, I'm trying to get an idea on this use case. How is this different from @ConditionalOnProperty on a @Configuration class that defines a bunch of beans?

    • @jimmyl9658
      @jimmyl9658 3 года назад +2

      ConditionalOnProperties applies to beans before they get registered.
      Here, objects are dynamically invoked. Add a Database/REST call (for example) and the logic is resolved at runtime.

    • @音羽の夢
      @音羽の夢 2 года назад

      @@jimmyl9658 Hi Jimmy, I have a question with "dynamically invoked". Does it means with Spring Plugins, objects are been lazily registered just like you put @Lazy on a normal bean?

  • @bendathierrycom
    @bendathierrycom Год назад

    A great video 👌👏