2023-01-28T13:00:46+00:00https://www.redditstatic.com/icon.png//r/DesignPatterns.rssA place to learn about Design Patterns. Feel free to ELI6.Object Oriented Programming Design Patterns/u/Donald___Draperhttps://www.reddit.com/user/Donald___Draper<!-- SC_OFF --><div class="md"><p>I have made a basic swing application to become familiar with mvc and observer design pattern. But to get experience with some others such Decorator, Visitor, State, Strategy and so on, I need ideas. Plase help me with that.</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/Donald___Draper"> /u/Donald___Draper </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/hjddqn/can_you_please_give_me_example_projects_to_use/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/hjddqn/can_you_please_give_me_example_projects_to_use/">[comments]</a></span>t3_hjddqn2020-07-01T16:16:39+00:002020-07-01T16:16:39+00:00Can you please give me example projects to use several design patterns combined to get experience?/u/Cypher032https://www.reddit.com/user/Cypher032<!-- SC_OFF --><div class="md"><p>The Canadian Government needs to set certain attributes for the Canadian provinces based on characteristics of each province and federal policies. For instance, health care and education budgets allocated to the provinces use formulas that take into account regional differences. There are many other operations whose components depend on provincial data. New operations are introduced every year and some operations may be removed.</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/Cypher032"> /u/Cypher032 </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/hfiymw/can_someone_tell_me_which_design_pattern_would_be/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/hfiymw/can_someone_tell_me_which_design_pattern_would_be/">[comments]</a></span>t3_hfiymw2020-06-25T09:10:55+00:002020-06-25T09:10:55+00:00Can someone tell me which design pattern would be applicable in the following scenario?/u/infiniteTakerhttps://www.reddit.com/user/infiniteTaker  submitted by   <a href="https://www.reddit.com/user/infiniteTaker"> /u/infiniteTaker </a> <br/> <span><a href="https://medium.com/@anirban99/hexagonal-architecture-in-java-9031d3570d15">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/gpmidz/hexagonal_architecture_in_java/">[comments]</a></span>t3_gpmidz2020-05-24T09:01:40+00:002020-05-24T09:01:40+00:00Hexagonal Architecture in Java<!-- SC_OFF --><div class="md"><p>Can someone share some content around design patterns for ITSM system implementation?</p> <p>Any help/link/post in this topic would be appreciated.</p> <p>Thank you,</p> </div><!-- SC_ON --> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/glsrxn/design_pattern_for_itsm_systems/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/glsrxn/design_pattern_for_itsm_systems/">[comments]</a></span>t3_glsrxn2020-05-18T02:26:16+00:002020-05-18T02:26:16+00:00Design Pattern for ITSM systems?/u/jsamwriteshttps://www.reddit.com/user/jsamwrites  submitted by   <a href="https://www.reddit.com/user/jsamwrites"> /u/jsamwrites </a> <br/> <span><a href="https://thenextweb.com/syndication/2020/05/14/a-comprehensive-guide-to-javascript-design-patterns/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/gjrhm8/a_comprehensive_guide_to_javascript_design/">[comments]</a></span>t3_gjrhm82020-05-14T18:02:02+00:002020-05-14T18:02:02+00:00A comprehensive guide to JavaScript design patterns/u/Volosofthttps://www.reddit.com/user/Volosoft  submitted by   <a href="https://www.reddit.com/user/Volosoft"> /u/Volosoft </a> <br/> <span><a href="https://volosoft.com/blog/Prefer-Singleton-Pattern-over-Static-Class">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/ghn801/article_why_you_should_prefer_singleton_pattern/">[comments]</a></span>t3_ghn8012020-05-11T13:08:47+00:002020-05-11T13:08:47+00:00Article: Why You Should Prefer Singleton Pattern over a Static Class/u/kwatrasanchithttps://www.reddit.com/user/kwatrasanchit<!-- SC_OFF --><div class="md"><p>Hi programmers, </p> <p>While working on a project i am building an orchestrator which orchestrates the request b/w different modules and get the response back from them. While looking at the choice of design patterns i am stuck on deciding whether to choose Template pattern vs chain of responsibility design pattern. </p> <p>Template pattern is more simple and goes with our current use case, but chain of responsibility is more flexible. Any ideas on how to take a better design when thinking about different design patterns?</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/kwatrasanchit"> /u/kwatrasanchit </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/gcwhrp/template_vs_chain_of_responsibility_design_pattern/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/gcwhrp/template_vs_chain_of_responsibility_design_pattern/">[comments]</a></span>t3_gcwhrp2020-05-03T19:23:32+00:002020-05-03T19:23:32+00:00Template v/s Chain of responsibility Design Pattern/u/HafizWaleedHussain3https://www.reddit.com/user/HafizWaleedHussain3  submitted by   <a href="https://www.reddit.com/user/HafizWaleedHussain3"> /u/HafizWaleedHussain3 </a> <br/> <span><a href="https://www.uwanttolearn.com/design-patterns/decorator-structural-arrogant-design-pattern/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fzvfp0/decorator_design_pattern_a_powerful_but_neglected/">[comments]</a></span>t3_fzvfp02020-04-12T11:54:25+00:002020-04-12T11:54:25+00:00Decorator Design Pattern. A powerful but neglected structural design pattern. A practical and straightforward definition. Decorator Design Pattern is an inheritance + composition in the same class. More you can read in the posts. Thanks :)/u/UntouchedDruid4https://www.reddit.com/user/UntouchedDruid4<!-- SC_OFF --><div class="md"><p>The languages I’m familar with are PHP and Python. I’m not sure what to build as far a personal projects that is complex enough to utilize design patterns. The only thing I can think of is building a WYSIWYG user interface but I hate javascript with a passion.</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/UntouchedDruid4"> /u/UntouchedDruid4 </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fvlrsc/project_ideas_for_practicing_design_patterns/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fvlrsc/project_ideas_for_practicing_design_patterns/">[comments]</a></span>t3_fvlrsc2020-04-05T21:28:08+00:002020-04-05T21:28:08+00:00Project ideas for practicing design patterns/u/HafizWaleedHussain3https://www.reddit.com/user/HafizWaleedHussain3  submitted by   <a href="https://www.reddit.com/user/HafizWaleedHussain3"> /u/HafizWaleedHussain3 </a> <br/> <span><a href="https://www.uwanttolearn.com/design-patterns/adapter-structural-arrogant-design-pattern/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fvd8u5/if_you_want_to_be_a_magician_in_coding_try_to/">[comments]</a></span>t3_fvd8u52020-04-05T12:45:55+00:002020-04-05T12:45:55+00:00If you want to be a magician in coding, try to grab the concept of Structural Design Patterns, in this post, we will discuss the Adapter Design Pattern which is one of the Structural Design Pattern./u/HafizWaleedHussain3https://www.reddit.com/user/HafizWaleedHussain3  submitted by   <a href="https://www.reddit.com/user/HafizWaleedHussain3"> /u/HafizWaleedHussain3 </a> <br/> <span><a href="https://www.uwanttolearn.com/design-patterns/builder-creational-arrogant-design-pattern/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/ft2r73/arrogant_builder_design_pattern_creational/">[comments]</a></span>t3_ft2r732020-04-01T16:14:40+00:002020-04-01T16:14:40+00:00Arrogant Builder Design Pattern -> Creational Pattern. 1. Mandatory VS Optional 2. Overloaded Constructor + Constructor Chaining 3. Any requirement in which we will select individual items and later we will check out those items in the form of an Order./u/HafizWaleedHussain3https://www.reddit.com/user/HafizWaleedHussain3  submitted by   <a href="https://www.reddit.com/user/HafizWaleedHussain3"> /u/HafizWaleedHussain3 </a> <br/> <span><a href="https://www.uwanttolearn.com/design-patterns/factory-creational-arrogant-design-pattern/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fs2uok/arrogant_factory_desing_pattern_creational/">[comments]</a></span>t3_fs2uok2020-03-31T00:33:36+00:002020-03-31T00:33:36+00:00Arrogant Factory Desing Pattern -> Creational Pattern. What is the use-case of the Factory Design Pattern? 1. When we can see Inheritance/Polymorphism in our code. (50%) 2. Inherit class creation depends on some logic or enums. (50%)/u/HafizWaleedHussain3https://www.reddit.com/user/HafizWaleedHussain3  submitted by   <a href="https://www.reddit.com/user/HafizWaleedHussain3"> /u/HafizWaleedHussain3 </a> <br/> <span><a href="https://www.uwanttolearn.com/design-patterns/arrogant-design-patterns/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fr3gxl/arrogant_design_patterns/">[comments]</a></span>t3_fr3gxl2020-03-29T09:49:47+00:002020-03-29T09:49:47+00:00Arrogant Design Patterns/u/Michalf94https://www.reddit.com/user/Michalf94  submitted by   <a href="https://www.reddit.com/user/Michalf94"> /u/Michalf94 </a> <br/> <span><a href="https://www.devdiaries.net/blog/Java-Strategy-Design-Pattern-By-Examples/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fj4v7y/strategy_design_pattern_with_examples_in_java/">[comments]</a></span>t3_fj4v7y2020-03-15T17:25:34+00:002020-03-15T17:25:34+00:00Strategy Design Pattern with examples in Java. Kill the virus with Strategy Pattern!/u/rennnathttps://www.reddit.com/user/rennnat<!-- SC_OFF --><div class="md"><p>I'm an OOP guy who loves C++ and has been involved with Flutter/Dart (Object Oriented & Strongly-Typed). There's a lot of entry point devs in those communities who don't understand the brilliance of design patterns and have problems that are solved by such patterns.</p> <p>I'm making a series of videos for these communities about design patterns and using real-world examples to teach them.</p> <p>HOWEVER, I'd really appreciate any small bit of feedback or additions from your experiences. Thank you sooo much to anyone willing to help me out.</p> <p>Here's how you can help:</p> <blockquote> <p>What are your most used design patterns?</p> <p>What is one of the most influential lessons you've learned about design patterns?</p> </blockquote> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/rennnat"> /u/rennnat </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fewhln/im_instilling_a_passion_for_design_patterns_in/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fewhln/im_instilling_a_passion_for_design_patterns_in/">[comments]</a></span>t3_fewhln2020-03-07T15:22:07+00:002020-03-07T15:22:07+00:00I'm instilling a passion for design patterns in people and could use some help./u/devsidevhttps://www.reddit.com/user/devsidev<!-- SC_OFF --><div class="md"><p>So I've always had trouble trying to keep implementations generic. I find that every solution needs some sort of bespoke function . For example, I recently implemented a SendGrid as a way of handling emails for drip campaigns. I wrote a SendGrid class that inherited from a DripInterface.</p> <p>However, what if SendGrid doesn't work out, and we want to switch to Mailgun for the drip campaigns? Well for the most part, we'll write a concrete MailGun implementation and we won't need to change anywhere other than where the dependency injection is handled.</p> <p>There are a lot of functions that cross over perfectly, I can handle contact lists, (GET/PUT/DELETE), categories, sub categories etc, and I can create interface entries for these all. But <strong>how do you handle it when there's something specific to the Concrete class that I need to use</strong>, that doesn't work in the same way as any future concrete classes?</p> <p>At this point I always end up writing code that kinda suits SendGrid, and when we have to switch out to Mailgun I'll have to find every file that injects the DripInterface, and swap out the method calls or add a few more to specifically handle this different class.</p> <p>What's a clean solution to this? Thanks!</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/devsidev"> /u/devsidev </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fe2txe/creating_an_interface_for_dependency_injection/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fe2txe/creating_an_interface_for_dependency_injection/">[comments]</a></span>t3_fe2txe2020-03-05T21:53:04+00:002020-03-05T21:53:04+00:00Creating an interface for Dependency Injection/u/Hatefiendhttps://www.reddit.com/user/Hatefiend<!-- SC_OFF --><div class="md"><p>I feel like I'm either not fully underestanding MVC or realizing its shortcomings as a design pattern. The controller feels like it violates the rules of encapsulation. It has complete access to the entire front end GUI including access to frames, buttons, textfields, etc. That is not good. Buttons, textfields, frames, stages, images, etc are all part of the view and ONLY the view should modify said variables. Also it's very likely that inside the view, you can create objects of the model. That just doesn't make sense. Classes declared in the model should NOT exist in the view. They are completely seperate, which should mean that the identifiers for classes in the model should be unknown when I attempt to reference them in the view. This is <em>somewhat</em> possible with packages in a language like Java but overall I never see people do this.</p> <p>Same problems with the model. I might have a model of a <code>Racecar</code>. My controller might have a section for <code>start car</code> which in turn calls <code>rc.ignition()</code>. But there's <strong>nothing</strong> that stops me from doing <code>rc.setWheels(0)</code>. Because my controller has access to the entire backend since its an instance variable, it has complete control over everything it can do. That doesn't make sense.</p> <p>I've taken two Object Oriented Design classes and in the advanced one, the teacher told me "Yes, this is true, but that is <strong>your design</strong>. It is okay for things to be this way, as long as its part of your intended design". I've really never liked that answer because it feels like it doesn't address the violation of the rules of MVC (model and view being completely seperate in every way).</p> <p>I had an idea on how to solve this, but wasn't sure exactly if it was a good idea.</p> <h1>Model</h1> <pre><code>class Racecar public int currentSpeed; public int wheels; public void speedUp() { ... } public void dismantleCar() { ... } </code></pre> <p>.</p> <pre><code>// read-only version of the speed indicator interface RacecarSpeedIndicator public int getCurrentSpeed(); </code></pre> <p>.</p> <pre><code>// next level of the hierarchy // gives way more permissions than the above one interface RacecarAccelerator extends RacecarSpeedIndicator public void speedUp(); </code></pre> <p>Then I have <code>Racecar</code> <code>extend</code> <code>RacecarSpeedIndicator</code> and <code>RacecarAccelerator</code>.</p> <p>When my front end needs to accelerate the car, it would look like this:</p> <pre><code>class Controller1 RacecarAccelerator rc; public Controller1(RacecarAccelerator rc) this.rc = rc; // here, Controller1 CAN ONLY speed up the car // and read the current speed. It cannot // possibly cause any harm to the race car </code></pre> <p>It's kind of like having access cards at a building. With a RED access card, you can access a certain number of areas. With a BLUE access card, you can access all RED zones and all BLUE zones, etc. You only give a section of code the BARE MINIMUM it needs to perform its funciton. But is this idea convoluted? Does it exist as a pattern? How does it contrast with MVC?</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/Hatefiend"> /u/Hatefiend </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fdsfz8/im_not_satisfied_with_mvc_feels_like_it_breaks/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/fdsfz8/im_not_satisfied_with_mvc_feels_like_it_breaks/">[comments]</a></span>t3_fdsfz82020-03-05T08:44:40+00:002020-03-05T08:44:40+00:00I'm not satisfied with MVC -- Feels like it breaks encapsulation/u/Rosechan1https://www.reddit.com/user/Rosechan1<!-- SC_OFF --><div class="md"><p>Learning dependency injection and wondering if this code implements it. My understanding is Actions dependency on Person is injected into its constructor.</p> <pre><code>class Person { } class Action { private person; __construct(Person person) { $this->person = person; } } Person jake = new Person(); Action jump = new Action(Person jake); </code></pre> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/Rosechan1"> /u/Rosechan1 </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/f78xa4/is_this_dependency_injection/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/f78xa4/is_this_dependency_injection/">[comments]</a></span>t3_f78xa42020-02-21T09:52:19+00:002020-02-21T09:52:19+00:00Is this dependency injection?/u/oribentovhttps://www.reddit.com/user/oribentov<!-- SC_OFF --><div class="md"><p>Hey all,</p> <p>I'm implementing a game in which a player has a boat and he needs to move with his boat and collect some stuff. he has score and life as well.</p> <p>I designed the system as the MVC pattern and right now I have a boatModel object which holds the data about the boat, BoatController which responsible to handle movements.</p> <p>I considered making a PlayerModel object which holds the data about the player, including life, score, and the BoatController. that's because conceptually the player has his own "boat driver"</p> <p>Is it make any sense that's a model object "has-a" controller (according to the MVC pattern)?</p> <p>If not, how it'll be better to design it?</p> <p>​</p> <p>Thanks.</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/oribentov"> /u/oribentov </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/f08m28/should_a_data_model_hold_a_controller_mvc/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/f08m28/should_a_data_model_hold_a_controller_mvc/">[comments]</a></span>t3_f08m282020-02-07T10:20:21+00:002020-02-07T10:20:21+00:00should a data model hold a controller? (MVC)/u/Khalid_______https://www.reddit.com/user/Khalid_______<!-- SC_OFF --><div class="md"><p>Hi, i have to design an asp.net web system for a company for managing employees , their salary , holidays , loans , advances, their children schoolarship accomodations , passports renewal fees, every thing the company take care of the emploee needs to be systemize, ppl what your advice for me to achieve this system , what samples may be availabe online such as erp's or hr system and what design pattern should i use, im good at programming but havenot had such case before , i only used to develop small websites or apis or mobile apps cross platform on zamarin, and this system will be distributed on more than one branch, so i have to use distributed database hierarechy , already wer using replication on sql server, thanks for reading</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/Khalid_______"> /u/Khalid_______ </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/esrwb4/web_system_infering/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/esrwb4/web_system_infering/">[comments]</a></span>t3_esrwb42020-01-23T11:37:51+00:002020-01-23T11:37:51+00:00Web System Infering/u/kekomanci22https://www.reddit.com/user/kekomanci22<!-- SC_OFF --><div class="md"><p>Hello, </p> <p>There are probably dozens of possibilities, however, how would you deal with this ?</p> <p>​</p> <p>A few cameras are installed on a highway to catch trucks which carry hazardous or explosive materials, and record the data(brand- plate ect). The cameras and the archived data can be viewed by multiple departments of the police. What kind of design patterns can be used and how can you design a system architecture?</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/kekomanci22"> /u/kekomanci22 </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/er2tyj/which_patterns_would_you_use_and_what_kind_of/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/er2tyj/which_patterns_would_you_use_and_what_kind_of/">[comments]</a></span>t3_er2tyj2020-01-19T21:42:59+00:002020-01-19T21:42:59+00:00Which patterns would you use and what kind of system would you design/u/raghavanklhttps://www.reddit.com/user/raghavankl<!-- SC_OFF --><div class="md"><p><a href="https://medium.com/craftsmanship/future-proof-design-with-strategy-factories-bfe16daaabb8">https://medium.com/craftsmanship/future-proof-design-with-strategy-factories-bfe16daaabb8</a></p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/raghavankl"> /u/raghavankl </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/eoo9ye/future_proof_design_with_strategy_factories/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/eoo9ye/future_proof_design_with_strategy_factories/">[comments]</a></span>t3_eoo9ye2020-01-14T17:22:15+00:002020-01-14T17:22:15+00:00Future Proof Design with Strategy Factories/u/Avi_19https://www.reddit.com/user/Avi_19<!-- SC_OFF --><div class="md"><p>Dear Reddit,</p> <p>I made a very small example for my API calls using command-design-pattern. Basically, i want to add tokens, logging information when an API call is placed in my project. This code is just a starter point for it. Please review and feedbacks are well appreciated.<br/> <a href="https://github.com/techy19/design-patterns/tree/new-branch/src/command_patterns">https://github.com/techy19/design-patterns/tree/new-branch/src/command_patterns</a></p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/Avi_19"> /u/Avi_19 </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/ejyg47/command_pattern_example/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/ejyg47/command_pattern_example/">[comments]</a></span>t3_ejyg472020-01-04T16:10:36+00:002020-01-04T16:10:36+00:00Command pattern example/u/zeke13210https://www.reddit.com/user/zeke13210<!-- SC_OFF --><div class="md"><p>Is there such a thing as design pattern for working with building components out of react.js framework?</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/zeke13210"> /u/zeke13210 </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/ed3h7t/react_design_pattern_resources/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/ed3h7t/react_design_pattern_resources/">[comments]</a></span>t3_ed3h7t2019-12-20T02:13:15+00:002019-12-20T02:13:15+00:00React design pattern resources!/u/i_mahehttps://www.reddit.com/user/i_mahe<!-- SC_OFF --><div class="md"><p>The object has 4 states such as Active, Completed, Terminated and Cancelled. But most of the operations are happening in Active state. And from Active state it can directly go to any other state.</p> <p>I can easily anticipated some more states coming.</p> <p>Is it right to implement state design pattern with one abstract class?</p> <p>The operations on active state is 10 and other states is 2.</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/i_mahe"> /u/i_mahe </a> <br/> <span><a href="https://www.reddit.com/r/DesignPatterns/comments/e6casw/state_design_pattern_clarification_on_usecase/">[link]</a></span>   <span><a href="https://www.reddit.com/r/DesignPatterns/comments/e6casw/state_design_pattern_clarification_on_usecase/">[comments]</a></span>t3_e6casw2019-12-05T05:00:37+00:002019-12-05T05:00:37+00:00State design pattern clarification on usecase