Design maxims

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(New page: == Object oriented design maxims == maxim:: (noun) A general truth or rule of conduct expressed in a sentence. Lets use the term ''maxim'' to mean all the rules, laws, guidelines, princ...)
 
m (Reverted edits by Ebybymic (Talk); changed back to last version by LukeRobinson)
 
(50 intermediate revisions by 14 users not shown)
Line 1: Line 1:
== Object oriented design maxims ==
+
== Object Oriented Design Maxims ==
  
 
  maxim:: (noun) A general truth or rule of conduct expressed in a sentence.
 
  maxim:: (noun) A general truth or rule of conduct expressed in a sentence.
  
Lets use the term ''maxim'' to mean all the rules, laws, guidelines, principles, heuristics, strategies, patterns and idioms that are named by a standard phrase.
+
Let's use the term ''maxim'' to mean all the rules, laws, guidelines, principles, heuristics, strategies, patterns and idioms that are named by a standard phrase.
 +
 
 +
[[Maxim Hierarchy]] - An attempt at creating a hierarchy of maxims can be found here.
  
 
=== Maxims ===
 
=== Maxims ===
  
* AcyclicDependenciesPrinciple
+
* [[Acyclic dependencies principle]]
* AvoidDowncasting
+
* [[Avoid downcasting]]
* AvoidEquals
+
* [[Avoid equals]]
* AvoidInheritanceForImplementation
+
* [[Avoid inheritance for implementation]]
* AvoidSideEffects
+
* [[Avoid side effects]]
* BehavioralCompleteness
+
* [[Behavioral completeness]]
* BigDesignUpFront
+
* [[Big design up front]]
* CommandQuerySeparation
+
* [[Command query separation]]
* CommonClosurePrinciple
+
* [[Common closure principle]]
* CommonReusePrinciple
+
* [[Common reuse principle]]
* CouplingAndCohesion
+
* [[Coupling and cohesion]]
* DependencyInversionPrinciple
+
* [[Dependency injection]]
* DesignByContract
+
* [[Dependency inversion principle]]
* DontBurnYourBaseClass
+
* [[Design by contract]]
* DontExposeMutableAttributes
+
* [[Don't burn your base class]]
* DontRepeatYourself
+
* [[Don't expose mutable attributes]]
* DoTheSimplestThingThatCouldPossiblyWork
+
* [[Don't repeat yourself]]
* EncapsulateThatWhichVaries
+
* [[Do the simplest thing that could possibly work]]
* EncapsulationIsHierarchical
+
* [[Encapsulate that which varies]]
* FatInterfaces
+
* [[Encapsulation is hierarchical]]
* FavorCompositionOverInheritance
+
* [[Encapsulation boundary]]
* GettersAndSetters
+
* [[Establishing priorities]]
* GotoConsideredHarmful
+
* [[Fat interfaces]]
* HideYourDecisions
+
* [[Favor composition over inheritance]]
* ImpedanceMismatch
+
* [[Getters and setters]]
* InformationHiding
+
* [[Goto considered harmful]]
* InterfaceSegregationPrinciple
+
* [[Hide your decisions]]
* KeepAccessorsAndMutatorsSeparate
+
* [[Impedance mismatch]]
* KeepItSimple
+
* [[Information hiding]]
* LawOfDemeter
+
* [[Intelligent children pattern]]
* LiskovSubstitutionPrinciple
+
* [[Interface segregation principle]]
* ModelTheRealWorld
+
* [[Keep accessors and mutators separate]]
* NamedConstants
+
* [[Keep it simple]]
* NoConcreteBaseClasses
+
* [[Law of Demeter]]
* NoSilverBullet
+
* [[Law of leaky abstractions]]
* OneResponsibilityRule
+
* [[Liskov substitution principle]]
* OpenClosedPrinciple
+
* [[Model the real world]]
* OnceAndOnlyOnce
+
* [[Named constants]]
* PrematureOptimization
+
* [[No concrete base classes]]
* ProgramToTheInterfaceNotTheImplementation
+
* [[No silver bullet]]
* ReuseReleaseEquivalencePrinciple
+
* [[Once and only once]]
* SingleResponsibilityPrinciple
+
* [[One responsibility rule]]
* SeparationOfConcerns
+
* [[Open closed principle]]
* SingleChoicePrinciple
+
* [[Option-operand separation]]
* SoftwareCrisis
+
* [[Premature optimization]]
* SoftwareReuse
+
* [[Program to the interface not the implementation]]
* StableAbstractionsPrinciple
+
* [[Reuse release equivalence principle]]
* StableDependenciesPrinciple
+
* [[Single responsibility principle]]
* TellDontAsk
+
* [[Separation of concerns]]
* YouAintGonnaNeedIt
+
* [[Single choice principle]]
 +
* [[Software crisis]]
 +
* [[Software reuse]]
 +
* [[Stable abstractions principle]]
 +
* [[Stable dependencies principle]]
 +
* [[Tell, Don't Ask]]
 +
* [[You ain't gonna need it]]
 +
 
 +
==Clumps of Maxims==
 +
These are groups of Maxims, usually gathered by the developer(s) who proposed them.
 +
 
 +
===COSC 427's:===
 +
* [[Make constructors blocking]]
 +
* [[No Peter Pan objects]]
 +
* [[Avoid mixing inputs and outputs]]
 +
 
 +
=== [[Johnson and Foote's heuristics]]:===
 +
* [[Recursion introduction]]
 +
* [[Eliminate case analysis]]
 +
* [[Reduce the number of arguments]]
 +
* [[Reduce the size of methods]]
 +
* [[Class hierarchies should be deep and narrow]]
 +
* [[The top of the class hierarchy should be abstract]]
 +
* [[Minimize accesses to variables]]
 +
* [[Subclasses should be specializations]]
 +
* [[Split large classes]]
 +
* [[Factor implementation differences into subcomponents]]
 +
* [[Separate methods that do not communicate]]
 +
* [[Send messages to components instead of to self]]
 +
* [[Reduce implicit parameter passing]]
 +
 
 +
===[[Riel's heuristics]]:===
 +
* All of Riel's heuristics can be found [[Riel's heuristics|here]].
 +
 
 +
===[[Bob Martin's principles]]:===
 +
* (SRP) The [[Single responsibility principle]]
 +
* (OCP) The [[Open/closed principle]]
 +
* (LSP) The [[Liskov substitution principle]]
 +
* (DIP) The [[Dependency inversion principle]]
 +
* (ISP) The [[Interface segregation principle]]
 +
* (REP) The [[Reuse release equivalence principle]]
 +
* (CCP) The [[Common closure principle]]
 +
* (CRP) The [[Common reuse principle]]
 +
* (ADP) The [[Acyclic dependencies principle]]
 +
* (SDP) The [[Stable dependencies principle]]
 +
* (SAP) The [[Stable abstractions principle]]
 +
 
 +
===[[Ken Auer 1995]]:===
 +
* [[Define classes by behavior, not state pattern]]
 +
* [[Implement behavior with abstract state pattern]]
 +
* [[Identify message layers pattern]]
 +
* [[Defer identification of state variables pattern]]
 +
* [[Encapsulate concrete state pattern]]
 +
* [[Use lazy initialization pattern]]
 +
* [[Define default values via explicit protocol pattern]]
 +
 
 +
===[[Alan Davis 1995]]:===
 +
To be completed...
 +
 
 +
===[[William Brown 1998]]:===
 +
* [[Managing functionality]]
 +
* [[Managing performance]]
 +
* [[Managing complexity]]
 +
* [[Managing change]]
 +
* [[Managing IT resources]]
 +
* [[Managing technology transfer]]
 +
 
 +
===[[Joshua Bloch]]:===
 +
* [[Joshua Bloch 2006 Bumper Sticker API Design | Bumper Sticker API Design]]
  
'''Clumps of maxims'''
+
== See Also ==
* JohnsonAndFootesHeuristics:
+
* [[Code smells]]
  * RecursionIntroduction.
+
* [[Patterns]]
  * EliminateCaseAnalysis.
+
* [http://programmer.97things.oreilly.com/wiki/index.php/Edited_Contributions Edited Contributions] - A whole heap of maxims and ideas...
  * ReduceTheNumberOfArguments.
+
  * ReduceTheSizeOfMethods.
+
  * ClassHierarchiesShouldBeDeepAndNarrow.
+
  * TheTopOfTheClassHierarchyShouldBeAbstract.
+
  * MinimizeAccessesToVariables.
+
  * SubclassesShouldBeSpecializations.
+
  * SplitLargeClasses.
+
  * FactorImplementationDifferencesIntoSubcomponents.
+
  * SeparateMethodsThatDoNotCommunicate.
+
  * SendMessagesToComponentsInsteadOfToSelf.
+
  * ReduceImplicitParameterPassing
+
* RielsHeuristics:
+
* BobMartinsPrinciples:
+
  * (SRP) The SingleResponsibilityPrinciple
+
  * (OCP) The OpenClosedPrinciple
+
  * (LSP) The LiskovSubstitutionPrinciple
+
  * (DIP) The DependencyInversionPrinciple
+
  * (ISP) The InterfaceSegregationPrinciple
+
  * (REP) The ReuseReleaseEquivalencePrinciple
+
  * (CCP) The CommonClosurePrinciple
+
  * (CRP) The CommonReusePrinciple
+
  * (ADP) The AcyclicDependenciesPrinciple
+
  * (SDP) The StableDependenciesPrinciple
+
  * (SAP) The StableAbstractionsPrinciple
+
* KenAuer1995:
+
  * DefineClassesByBehaviorNotStatePattern.  
+
  * ImplementBehaviorWithAbstractStatePattern.  
+
  * IdentifyMessageLayersPattern.  
+
  * DeferIdentificationOfStateVariablesPattern.  
+
  * EncapsulateConcreteStatePattern.  
+
  * UseLazyInitializationPattern.  
+
  * DefineDefaultValuesViaExplicitProtocolPattern.
+
* AlanDavis1995:
+
* CodeSmells
+

Latest revision as of 03:08, 25 November 2010

Contents

Object Oriented Design Maxims

maxim:: (noun) A general truth or rule of conduct expressed in a sentence.

Let's use the term maxim to mean all the rules, laws, guidelines, principles, heuristics, strategies, patterns and idioms that are named by a standard phrase.

Maxim Hierarchy - An attempt at creating a hierarchy of maxims can be found here.

Maxims

Clumps of Maxims

These are groups of Maxims, usually gathered by the developer(s) who proposed them.

COSC 427's:

Johnson and Foote's heuristics:

Riel's heuristics:

  • All of Riel's heuristics can be found here.

Bob Martin's principles:

Ken Auer 1995:

Alan Davis 1995:

To be completed...

William Brown 1998:

Joshua Bloch:

See Also

Personal tools