Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Sounds like you want some basic yes/no questions to ask yourself along your way. Everyone has given some great "do this" and "think like that" lists, so here is my crack at some simple yes/no's.</p> <p>Can I answer yes to all of these? </p> <ul> <li>Do my classes represent the nouns I am concerned with?</li> <li>Do my classes provide methods for actions/verbs that it can perform?</li> </ul> <p>Can I answer no to all of these?</p> <ul> <li>Do I have global state data that could either be put into a singleton or stored in class implementations that work with it?</li> <li>Can I remove any public methods on a class and add them to an interface or make them private/protected to better encapsulate the behavior?</li> <li>Should I use an interface to separate a behavior away from other interfaces or the implementing class?</li> <li>Do I have code that is repeated between related classes that I can move into a base class for better code reuse and abstraction?</li> <li>Am I testing for the type of something to decide what action to do? If so can this behavior be included on the base type or interface that the code in question is using to allow more effect use of the abstraction or should the code in question be refactored to use a better base class or interface?</li> <li>Am I repeatedly checking some context data to decided what type to instantiate? If so can this be abstracted out into a factory design pattern for better abstraction of logic and code reuse?</li> <li>Is a class very large with multiple focuses of functionality? If so can I divide it up into multiple classes, each with their own single purpose?</li> <li>Do I have unrelated classes inheriting from the same base class? If so can I divide the base class into better abstractions or can I use composition to gain access to functionality?</li> <li>Has my inheritance hierarchy become fearfully deep? If so can I flatten it or separate things via interfaces or splitting functionality?</li> <li>I have worried way too much about my inheritance hierarchy?</li> <li>When I explain the design to a rubber ducky do I feel stupid about the design or stupid about talking to a duck?</li> </ul> <p>Just some quick ones off the top of my head. I hope it helps, OOP can get pretty crazy. I didn't include any yes/no's for more advanced stuff that's usually a concern with larger apps, like dependency injection or if you should split something out into different service/logic layers/assemblies....of course I hope you at least separate your UI from your logic.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload