Stepwise Builder (Wizard) in C#

Поделиться
HTML-код
  • Опубликовано: 4 дек 2024

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

  • @viv_2489
    @viv_2489 3 года назад +4

    I have purchased your design patterns course in Udemy earlier.... Nice content..

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

      Great! Note that these videos are also added to the course. Enjoy!

  • @aah134-K
    @aah134-K 3 года назад

    Very nice. I like it a lot

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

    Hello, Dmitry. What do you think about marking Builder classes with a specific Interface or somehow else just to highlight that this class/interface is a builder? What do you think about (possibility) for IDE support for hierarchical builders code formatting?

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

      Theoretically you could introduce some IBuilder interface with a T Build() method. It is of course of singular use, because you cannot overload two of those without explicit interface members. Similarly you could have IBuildableUsing with a property T New { get; } returning the builder - this is also not overloadable. As to your second question, I don't quite understand what you're asking.

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

      ```interface IBuildableUsing
      where TBuilder : IBuilder
      where TSubject : IBuildableUsing
      {
      TBuilder New { get; }
      }
      interface IBuilder
      where T : IBuildableUsing
      {
      T Build();
      }```

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

      @@DmitriNesteruk youtrack.jetbrains.com/issue/RSRP-440686 It's actual for hierarchical builders.

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

    Isn't it sounds like Method Chaining pattern/approach?

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

      You can chain methods in any order by returning a reference of the working object (fluent interface idea).
      In this case (Stepwise Builder) the order of object construction is strictly defined.

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

    Neat!