State Design Pattern (C#)

Поділитися
Вставка
  • Опубліковано 26 вер 2024
  • 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

КОМЕНТАРІ • 27

  • @BruceLeeBeatz
    @BruceLeeBeatz 2 роки тому +7

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

  • @Gleem
    @Gleem 3 роки тому +3

    What a good analogy with the drinking state.

  • @justadude8716
    @justadude8716 Рік тому

    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.

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

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

  • @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.

  • @nikosevangelopoulos3605
    @nikosevangelopoulos3605 3 роки тому +1

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

  • @thatcreole9913
    @thatcreole9913 3 роки тому +2

    Fantastic!

  • @ДмитрийЯворский-е1ф

    Great explanation)

  • @LucasMarinoElementh
    @LucasMarinoElementh 3 роки тому +1

    Damn good, thanks mate!

    • @RawCoding
      @RawCoding  3 роки тому

      Thank you for watching)

  • @davidwhite2011
    @davidwhite2011 3 роки тому +2

    Drunk coding!

  • @008uzair
    @008uzair Рік тому

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

  • @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.

  • @clearlyunwell
    @clearlyunwell 3 роки тому +1

    👍🏽

  • @markyanthonylaredo2614
    @markyanthonylaredo2614 3 роки тому +1

    FIrst