TekPub - C# Design Strategies with Jon Skeet
English | MP4 | 1280x720 | AVC 580 Kbps 30.000 fps | AAC 128 Kbps 48.0 khz | 3h 24mn | 963 MB
Genre: Video Training
We start the series off with a bang - tackling a design pattern that plagues most developers - no matter the language. The Singleton is reviled by many - mostly because it's nearly impossible to do it correctly. In this episode Jon takes it on and shows you not one, not two - but SIX different ways to do a Singleton. And talks about various pitfalls along the way.
2 - Interfaces 20:52
Using interfaces is accepted by many as something "you should just do". But why? What do interfaces do for you? How are they better then just using basic object construction? In this episode Jon uses Noda Time (his OSS project) and shows you how the use of interfaces has helped him surmount the perils of System.DateTime in .NET.
3 - Dependency Injection 14:49
Using interfaces is a great way to loosen up your code's various dependencies - but how do you go about putting together an application that effectively uses that interfaces? One pattern than many developers like is Dependency Injection, and Jon explains how this patterns works in a real-world project: Noda Time. You get to see how this pattern is used in the wild to make code more flexible and maintainable.
4 - Inversion of Control 15:10
Our code is getting looser and our hard-coded dependencies are making future maintenance less-frightening - but we are now faced with a new problem: getting a new object is becoming a bit of a pain as we need to pass in all the dependencies! This can be a nightmare - and it's a good thing we have Inversion of Control containers to help us out. In this episode Jon refactors his code to make use of a home-spun IoC container, and shows concisely how he's helping his future self maintain his large Noda Time project.
5 - Outtake: Skeet Builds an IoC Container 16:58
During the recording of Episode 4 (Inversion of Control) we asked Jon to "lead people along and show them the need" for using Inversion of Control with Dependency Injection. We expected a rough, hard-coded factory-style of thing, but no, Jon built a small, functional IoC container from scratch. We decided to include it here because it's fascinating to watch and... he's Skeet!
6 - Type Meaning And Single Responsibility 20:57
Designing a Conceptual Model is not easy, and quite often we can engineer ourselves into a very tricky spot with types that do multiple things for multiple reasons. In this episode, Jon takes apart System.DateTime - the poster child for "doing too much" (even the name has two concepts) in an effort to drive home the need for Single Responsibility and Type Clarity.
7 - Open, Closed and Substitution 22:51
Working our way through SOLID principles, Jon tackles the Open/Closed principle and Liskov's Substitution. Along the way we discuss how to facilitate change and extension in an API's inheritance scheme.
8 - Factory Pattern 10:03
In this episode Jon talks about various ways to create an object instance, ans shows you how you can solve the confusion that can occur when you have too many constructor overloads - using the Factory Pattern.
9 - Builder Pattern 12:21
In this episode Jon explores what happens when constructors and factories start getting a bit too complex and you need to formalize options for creating an instance of your exciting business object.
10 - Strategy Pattern 09:00
In this episode Jon shows the simplicity and power of the Strategy Pattern, creating his own comparison strategy for a list of people and their birthdays.
11 - Composition with the Decorator 15:27
Jon likes composition vs. inheritance - and one pattern that really helps with this is the Decorator pattern, which allows you to add behavior (or "decorate") objects at execution time.
12 - State Pattern. Disposal Pattern, and Final Thoughts 11:19
In this episode Jon discusses the State Pattern and when you should use it - which is almost never. We tried to come up with an example that wasn't meaningless and overkill - and failed! Jon wraps things up with a discussion on what pattern use should mean to you - using the State Pattern as a punch line.