Before taking the Course
  • How to Ask Questions
  • Introduction to Unit Testing
  • Download Source Code and Slides
  • English Subtitles
  • Join .NET Community of Students
Dependency Inversion Principle and Dependency Injection
  • Outline
  • Definition of DIP
  • Dependencies
  • Volatile and Stable Dependencies
  • Definitions of IoC and DI
  • DIP Violation Demo
  • Refactoring to a Better Design Applying Dependency Injection
  • Dependency Injection Techniques
  • Architectural Implications
  • Common Smells of DIP Violation
  • Conclusion
Introduction to IoC-Containers (or DI-Containers)
  • Outline
  • Pure DI and IoC-Containers
  • Building a Simple IoC-Container
  • Service Locator Design Pattern
  • Demo With an IoC-Container
  • Conclusion
Dependency Injection - Related Anti-Patterns & Refactorings
  • Outline
  • Control Freak
  • Hidden Dependencies with Service Locator
  • Temporal Coupling and Constructor Injection
  • Constructor Over-Injection
  • Ambient Context
  • Facade Service
  • Property Injection VS Bastard Injection
  • Cyclic Dependencies
  • Conclusion
Dependency Injection Real-World Example
  • Outline
  • Application Overview
  • Data Access and Models
  • UI-Side
  • The Problem of Tight Coupling
  • Refactoring Process
  • Isolating the Bootstrapper
  • Consequences
  • Conclusion
Reaping the Fruits of DI
  • Outline
  • Adding New DAL
  • Writing Unit Tests for View Models
  • Conclusion
DI-Containers (IoC-Frameworks)
  • Outline
  • Overview of DI-Containers
  • Unity DI-Framework
  • Late Binding with Unity
  • Aspect-Oriented Programming (AOP)
  • Demonstration of the Problem of Boilerplate Code
  • Implementing AOP by Intercepting
  • Interception vs Pure DI vs AOP Tooling
  • Autofac and Castle.Windsor DI-Containers
  • Problems Related to DI-Containers
  • Conclusion
  • BONUS Lecture
Appendix. Intro to Unit Testing. Getting Started
  • Outline
  • What is a Unit Test
  • Unit Testing Frameworks
  • Your First Unit Test
  • Naming Conventions
  • Running and Debugging Unit Tests
  • Benefits of Unit Tests
  • Who Should Write Unit Tests and When
  • Programmer's Oath
  • Exercise: Degree Converter
  • Solution: Degree Converter
  • Conclusion
Appendix. Intro to Unit Testing. NUnit Framework
  • Outline
  • Assert Intro
  • Assert Demo
  • Arrange-Act-Assert
  • Running Tests from the Console
  • SetUp and TearDown
  • OneTimeSetUp and OneTimeTearDown
  • Parameterized Unit Tests
  • Grouping and Ignoring Unit Tests
  • Code Coverage
  • Exercise: FizzBuzz
  • Solution: FizzBuzz
  • Exercise: Parsing Roman Numerals
  • Solution: Parsing Roman Numerals
  • Exercise: Stack
  • Solution: Stack
  • Conclusion