State Design Pattern (C#)

Поделиться
HTML-код
  • Опубликовано: 8 фев 2025
  • The state design pattern explained with examples in code. Change behaviour of an object based on it's state.
    Patreon 🤝 / raw_coding
    Courses 📚 learning.raw-c...
    Shop 🛒 shop.raw-codin...
    Discord 💬 / discord
    Twitter 📣 / anton_t0shik
    Twitch 🎥 / raw_coding
    Playlist: • c# design patterns
    Source: github.com/raw...
    #csharp #state #designpatterns

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

  • @justadude8716
    @justadude8716 Год назад +1

    I like this pattern because very often I end up with a switch statement with nested if checks, and it is too complex for me to try to keep it in my head next week. I have common issues of making a change, that breaks the previous (how?) or next state. This pattern is really good for isolating states and following the OCP of SOLID. But it also adds some overhead, that can be more complex than a simple switch statement. Everything is a trade off is what I learned in architecture and software development.

  • @BruceLeeBeatz
    @BruceLeeBeatz 3 года назад +9

    drunk, tired and caffeinated? just a normal monday morning as a dev

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

    thanks for your great videos

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

    According to Wikipedia, in Software Engineering, behavioral design patterns are design patterns that identify common communication patterns among objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication. Behavioral patterns are those patterns that are concerned with the interaction between the objects. The interaction between the objects should be in such a way that they are talking to each other and still are loosely coupled. The loose coupling is the key to n-tier architecture.

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

      Thank you for sharing

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

    The structural state pattern could come in handy while using enum in code

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

    What a good analogy with the drinking state.

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

    my man Anton is trying to ddos youtube with design pattern videos. lets Gooo

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

    Fantastic!

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

    Damn good, thanks mate!

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

      Thank you for watching)

  • @ДмитрийЯворский-е1ф
    @ДмитрийЯворский-е1ф 3 года назад +2

    Great explanation)

  • @008uzair
    @008uzair 2 года назад

    Should have also shown how to call methods on Pen class from main method

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

    Drunk coding!

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

    👍🏽

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

    drinking state- oh, the russian in you! I don't understand why you don't get google ads so you could get promoted and get more views

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

      Haha, I haven’t tried but I don’t think it’ll be a good trade off

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

      @@RawCoding your video will show up as suggestions. If people don't click on your video you don't get charged. If they do is like 0.02-0.04$ per click. The good part is that if someone clicks and likes your content most likely will share with others with no charge for you, also you start with 50$ credit.

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

    FIrst