To Dispose or not To Dispose

When developing solutions for Sharepoint, it is important to dispose some object after use, for example SPSites and SPWebs created by you. But it is not always obvious when Dispose() should be called, and when it should not be called.

Roger Lamb made an excellent Posting about this subject, and it's maybe the single most important posting to read when doing Sharepoint Development.

Edit: Roger did not mention Workflows, and I made some tests that actually show the results you would expect: workflowProperties.Web should not be Disposed, the Workflow Runtime will take care of that. Same applies to workflowProperties.Item.Web.