Please take a look at the Client
class for each pattern to see how it is used.
Note: The examples are without validation and should not be used as it is.
- Applying UML and patterns by Craig Larman
- Holub on patterns by Allen Holub
- Patterns, principles, and practices of domain driven design by Scott Millett and Nick Tune
- DesignPatternsPHP
- Design Patterns Game
- Head First Design Patterns by Kathy Sierra, Bert Bates, Elisabeth Robson, Eric Freeman
- OODesign
- Wikipedia - Design Patterns
- Refactoring.Guru
Remember, principles are not mandatory rules but guidelines.
Fail fast.
Do validation as early as possible.
One return statement
Only one return statement per function, multiple returns may be overlooked.
Less is more.
Remember to be explicit - Do not confuse it with shortened code which is not necessarily more readable.
Just in time.
Start small and transparent. Use patterns when requirements changes, to make it more maintainable. You do not have to begin with a pattern.
Using camelCase for abbreviations
Example: "XML Http Request" becomes "XmlHttpRequest" not "XMLHTMLRequest"