C++ Builder design pattern: A pragmatic approach

Поділитися
Вставка

КОМЕНТАРІ • 7

  • @goksanisil9107
    @goksanisil9107 Рік тому +2

    Appreciate your clarity (both in slides and narration), pragmatic approach and minimalism.

  • @RishmaceInDaFace
    @RishmaceInDaFace 2 місяці тому +1

    My first language is english and you speak 100x more clearly and amazing vocabulary 😂, very well explained video

  • @TheFinagle
    @TheFinagle 4 місяці тому

    Thank you for this clear description. This is what I needed for my own Menu backend I have been working on. I was trying to figure out how to have a lot of options for overlapping functionality without having to have a ton of different classes or calls - I can wrap each base functionality into a component and use a builder like design to construct a composition class that has whatever is needed for a particular element.
    Sometimes I find the text book descriptions of things like this kinda hard to visualize, and the extremely simple sample code snippets too simple to show whats going on. I like these more moderately complex samples that actually show things at work and give room to think a bit about how data is being moved around to get where it needs to be.

    • @platisd
      @platisd  4 місяці тому

      Very happy to hear the example suited right for your use case! 👌

  • @MartinCordova
    @MartinCordova 8 місяців тому

    Very well explained

  • @anthonysteinerv
    @anthonysteinerv 8 місяців тому

    If I want to reuse the builder object to build, let's say, 2 menus, do we have to create a new Menu after the std::move on the build method?

    • @platisd
      @platisd  8 місяців тому

      Correct. Alternatively, if you really want to avoid creating a new builder object (for whatever reason), you could instead store all the different "attributes" in the `Menu` class and only create a `Impl` object when someone calls the `build()` function.
      In that case the `withBorder`, `addOption` etc methods of the `Builder` class would merely set member variables and only create an `Impl` object upon the call of `build`.
      If you'd like us to discuss with more details and potentially code examples, please start an "issue" or a "discussion" in the GitHub repo (github.com/platisd/cpp-builder-pattern).