Abstract Factory Pattern Made Simple in C#

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

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

  • @7299566472
    @7299566472 Месяц назад

    is it recommended when we add more number of language & CIty?

  • @preslaviliev6843
    @preslaviliev6843 6 месяцев назад +1

    Really helpful !

  • @gefirson
    @gefirson 8 месяцев назад +3

    When you refactored to use ENUMS, you forgot the factory pattern. You've should have instantiated EnglandFactory/SpainFactory on your provider.

    • @campbelltech
      @campbelltech  7 месяцев назад +2

      You are right. I realized this and fixed in our Udemy course that is based on this video. Will have to update it here also.

  • @anurag3487
    @anurag3487 6 месяцев назад +2

    I think we need to return the individual factories from the provider methods, and not the interfaces.

    • @thesandboxgamingvideos
      @thesandboxgamingvideos 3 месяца назад

      Like this right ?
      IInternationalFactory internationalFactory = InternationalProvider.CreateCountry(Country.England);
      ILanguage language = internationalFactory.CreateLanguage();
      ICapitalCity capitalCity = internationalFactory.CreateCapitalCity();