Refactorings in C# - Replacing Constructors with Creation Methods

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

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

  • @derinteressierte8732
    @derinteressierte8732 6 часов назад

    yes, you can do that using the factory pattern. but that also has disadvantages. for example, the garbage collector often cannot destroy classes that have called such factory classes, which leads to memory problems. and a few other little things that I don't want to talk about.
    for two years I have been working for a company that has done something like that for decades and since then I have been de-sharing this code with a lot of effort.