I was reminded this morning of an email that I sent to the junior developers on my team when they joined us. It is an overview of some of the development practices, patterns and products that they would get exposed to on our project. I have included it here as a reference collection for others.
Principles and Patterns
These are things that I often use and are still learning to use.
- SOLID – Originally put together by Bob Martin (http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod). A good overview to read is at http://www.davesquared.net/2009/01/introduction-to-solid-principles-of-oo.html.
- LoD - Law of Demeter (or Principle of Least Knowledge) (http://en.wikipedia.org/wiki/Law_of_Demeter). Often referred to as loose coupling.
- DRY – Do not Repeat Yourself (http://en.wikipedia.org/wiki/Don't_repeat_yourself). Many say that this principle should not apply to unit testing.
- DIP – Dependency Injection Pattern which is the D in SOLID. Jeremy Miller has a good overview at http://codebetter.com/blogs/jeremy.miller/archive/2005/10/06/132825.aspx. Dependency Injection frameworks (Unity, Castle Windsor, Spring.Net etc) often use a Service Locator pattern for their implementation. Like Jeremy, my preference is constructor injection because it defines a contract of how to use a class whereas setter (or property) injection doesn’t. Setter injection should only be used for optional dependencies and usually requires additional defensive coding.
- TDD – Test Driven Development (http://en.wikipedia.org/wiki/Test-driven_development)
- DDD – Domain Driven Design is gaining popularity but still seems to be not well understood or widely used (including by me). See http://en.wikipedia.org/wiki/Domain-driven_design and MSDN Mag introduction article at http://msdn.microsoft.com/en-us/magazine/dd419654.aspx.
- AOP – Aspect Orientated Programming (http://en.wikipedia.org/wiki/Aspect-oriented_programming)
- Service Locator – See http://en.wikipedia.org/wiki/Service_locator_pattern and http://msdn.microsoft.com/en-us/library/cc707905.aspx. Keep in mind that this is starting to be considered as an anti-pattern and should probably be avoided in favour of Dependency Injection.
- GOF - Gang of Four patterns (http://www.dofactory.com/Patterns/Patterns.aspx). I tend to use the following in GoF:
- Testing - http://en.wikipedia.org/wiki/Software_testing. Lots of areas to cover such as white box, black box, grey box, regression, non-functional (performance, load, globalisation), unit vs. integration testing, code coverage etc.
Jeremy Miller also writes a series called Patterns in Practice for MSDN Magazine (see list at http://msdn.microsoft.com/en-au/magazine/cc720886.aspx). They are all a good read, especially:
Tools
These are tools that are good to get experience using. Most of them relate to the patterns above. There are other tools used like ReSharper, dotTrace, StyleCop, WinMerge etc, but they don’t have the up skill requirement that the following tools do.
Probably the most important tool to start using is Rhino Mocks. The only way to get experience with it is to start writing unit tests in VS. See the documentation at http://ayende.com/wiki/Rhino+Mocks+Documentation.ashx.
Tags: Useful Links, Performance, StyleCop, ReSharper, Unit Testing, PostSharp, AOP, Dependency Injection, Unity