30% OFF - Use code HANDSON30 for 30% off any course or Dometrain Pro! Browse courses →
  • Courses
  • Learning Paths
  • Blogs
  • Authors
  • Leaderboard
  • Dometrain Pro
  • Shopping Basket

    Your basket is empty

  • Business Portal
  • Hands-On: SOLID Principles in C#

    Learn SOLID Principles in C# by completing hands-on C# exercises.

    About This Course

    Mastering the SOLID principles requires more than just understanding the theory behind them. You need to apply each principle directly in code, working through real scenarios that mirror the challenges you'll face in production. Our comprehensive Hands-on SOLID Principles in C# course, spanning nearly 13 hours, offers a deeply practical learning experience with exercises built to reinforce every concept using Dometrain's online Code Editor. You'll begin with the fundamentals of clean object-oriented design and progressively work through each SOLID principle: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. Along the way, you'll refactor messy code, identify design violations, and build components that are easier to test, extend, and maintain. A basic understanding of C# and object-oriented programming is all you need to get started. Dometrain is committed to helping developers build practical, career-ready skills that translate directly to the workplace. Take advantage of a 14-day free trial to explore the course and see if it's the right fit for you. Whether you're looking to write cleaner code, prepare for technical interviews, or level up your software architecture skills, you'll gain the practical experience and industry-proven practices needed to build better software.

    Course Curriculum

    12h 40m 11 sections
    What Is a Responsibility?
    10:00
    Identifying Methods That Do Too Much
    10:00
    Separating Calculation from Formatting
    10:00
    Separating Validation from Processing
    10:00
    Extracting Focused Methods from a Monolith
    10:00
    Single Purpose String Processors
    10:00
    Chapter Capstone - Invoice Line Item Processor
    10:00
    Extracting a Validator
    10:00
    Separating Data Parsing from Computation
    10:00
    Separating Input Formatting from Business Logic
    10:00
    Cohesion — Keeping Related Logic Together
    10:00
    Refactoring a God Method
    10:00
    Real-World SRP — Transaction Processor
    10:00
    Chapter Capstone - Student Grade Manager
    10:00
    Extending Behavior with New Classes
    10:00
    Using Inheritance to Extend Behavior
    10:00
    Abstract Classes and Virtual Methods for Extensibility
    10:00
    Polymorphism as the Key to OCP
    10:00
    Adding New Behavior Without Modifying Existing Code
    10:00
    Strategy Pattern Introduction
    10:00
    Chapter Capstone - Extensible Notification System
    10:00
    Using Interfaces for Extensibility
    10:00
    Strategy Pattern with Interfaces
    10:00
    Building Extensible Processors
    10:00
    Plugin Architecture
    10:00
    Composing Behaviors Through Abstractions
    10:00
    Real-World OCP Patterns
    10:00
    Chapter Capstone - Extensible Report Generator
    10:00
    Subtypes Must Be Substitutable
    10:00
    Behavioral Compatibility and Contracts
    10:00
    Preconditions Cannot Be Strengthened
    10:00
    Postconditions Cannot Be Weakened
    10:00
    The Classic Square-Rectangle Violation
    10:00
    Identifying LSP Violations in Code
    10:00
    Chapter Capstone - Fixing LSP Violations
    10:00
    When Inheritance Is the Wrong Tool
    10:00
    Designing Type Hierarchies That Respect Behavioral Contracts
    10:00
    Invariant Preservation in Derived Classes
    10:00
    Exception Behavior in Derived Classes
    10:00
    Testing Substitutability
    10:00
    Real-World LSP-Compliant Design
    10:00
    Chapter Capstone - Building an LSP-Compliant Hierarchy
    10:00
    No Client Should Depend on Methods It Doesn't Use
    10:00
    Identifying Fat Interfaces
    10:00
    The Cost of NotImplementedException
    10:00
    Splitting Interfaces by Client Need
    10:00
    Role Interfaces vs Header Interfaces
    10:00
    Refactoring from One Large Interface to Many Focused Ones
    10:00
    Chapter Capstone - Refactoring a Fat Interface
    10:00
    Composing Multiple Small Interfaces
    10:00
    Interface Composition Patterns
    10:00
    Classes Implementing Multiple Focused Interfaces
    10:00
    ISP and Its Relationship to LSP
    10:00
    Real-World Interface Design Patterns
    10:00
    Adapter Pattern for Interface Compliance
    10:00
    Chapter Capstone - Building a System with Segregated Interfaces
    10:00
    Identifying Tight Coupling Between Layers
    10:00
    High-Level Modules Should Not Depend on Low-Level Modules
    10:00
    Both Should Depend on Abstractions
    10:00
    Abstractions Should Not Depend on Details
    10:00
    Introducing Abstractions Between Layers
    10:00
    Constructor Injection Basics
    10:00
    Chapter Capstone - Inverting a Dependency
    10:00
    Constructor Injection Patterns
    10:00
    Method Injection for Optional Dependencies
    10:00
    Building Loosely-Coupled Services
    10:00
    Repository Pattern as DIP in Action
    10:00
    Service Layers That Depend on Interfaces
    10:00
    Composing a System with Inverted Dependencies
    10:00
    Chapter Capstone - Building a Loosely-Coupled System
    10:00
    Refactoring SRP and OCP Violations
    10:00
    Refactoring LSP and ISP Violations
    10:00
    Applying DIP to Tightly-Coupled Code
    10:00
    Designing a SOLID Notification System
    10:00
    The Ultimate SOLID Refactoring
    10:00
    Chapter Capstone - The SOLID Code Architect
    10:00

    Meet Your Instructor

    Nick Chapsas

    Nick Chapsas

    Nick Chapsas is a .NET & C# content creator, educator and a Microsoft MVP for Developer Technologies with years of experience in Software Engineering and Engineering Management.

    He has worked for some of the biggest companies in the world, building systems that served millions of users and tens of thousands of requests per second.

    Nick creates free content on YouTube and is the host of the Keep Coding Podcast.

    View all courses by Nick Chapsas

    What's New

    Getting Started: Model Context Protocol (MCP)
    course

    Getting Started: Model Context Protocol (MCP)

    Learn how to get started with the Model Context Protocol (MCP) and integrate it into your applications.

    Learn more about Getting Started: Model Context Protocol (MCP)
    Hands-On: Learn TypeScript
    course

    Hands-On: Learn TypeScript

    Learn TypeScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn TypeScript
    Hands-On: Learn JavaScript
    course

    Hands-On: Learn JavaScript

    Learn JavaScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn JavaScript
    Hands-On: Data Structures & Algorithms in C#
    course

    Hands-On: Data Structures & Algorithms in C#

    Master data structures and algorithms through hands-on coding exercises in C#. Free to enroll for 7 days!

    Learn more about Hands-On: Data Structures & Algorithms in C#
    Blogsmith.ai
    feature

    Blogsmith.ai

    Turn your videos into blogs and newsletters with AI. Check out our new product at blogsmith.ai.

    Learn more about Blogsmith.ai
    Leaderboard
    feature

    Leaderboard

    See how you stack up against other learners. Track your progress, climb the ranks, and compete with the Dometrain community.

    Learn more about Leaderboard
    Hands-On: Learn PostgreSQL
    course

    Hands-On: Learn PostgreSQL

    Learn PostgreSQL through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn PostgreSQL
    Free Hands-On: C# for Beginners
    course

    Free Hands-On: C# for Beginners

    Learn C# through hands-on coding exercises. Practice what you learn with interactive challenges designed for everyone, from beginners to experts.

    Learn more about Free Hands-On: C# for Beginners
    Getting Started: AI for .NET Developers
    course

    Getting Started: AI for .NET Developers

    Get started with integrating AI into your .NET applications effectively using the latest LLM best practices.

    Learn more about Getting Started: AI for .NET Developers
    Getting Started: Building .NET Applications on AWS
    course

    Getting Started: Building .NET Applications on AWS

    Learn how to build and deploy .NET applications on AWS using CDK, Lambda, DynamoDB, S3, and more.

    Learn more about Getting Started: Building .NET Applications on AWS
    What's new in C# 14
    blog

    What's new in C# 14

    This guide covers every new C# 14 feature, explains its benefits, and provides practical code examples to help you navigate how you can use them.

    Learn more about What's new in C# 14
    Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    course

    Let's Build It: AI Chatbot with RAG in .NET Using Your Data

    Build a Retrieval-Augmented Generation (RAG) chatbot that can answer questions using your data.

    Learn more about Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    From Zero to Hero: SignalR in .NET
    course

    From Zero to Hero: SignalR in .NET

    Enable enterprise-grade real-time communication for your web apps with SignalR.

    Learn more about From Zero to Hero: SignalR in .NET
    Deep Dive: Solution Architecture
    course

    Deep Dive: Solution Architecture

    Master solution architecture and turn business needs into scalable, maintainable systems.

    Learn more about Deep Dive: Solution Architecture
    Migrating: ASP.NET Web APIs to ASP.NET Core
    course

    Migrating: ASP.NET Web APIs to ASP.NET Core

    A step-by-step process to migrate ASP.NET Web APIs from .NET Framework to ASP.NET Core.

    Learn more about Migrating: ASP.NET Web APIs to ASP.NET Core
    Getting Started: Caching in .NET
    course

    Getting Started: Caching in .NET

    Let's make the hardest thing in programming easy for .NET software engineers.

    Learn more about Getting Started: Caching in .NET
    From Zero to Hero: Testing with xUnit in C#
    course

    From Zero to Hero: Testing with xUnit in C#

    Learn how to test any codebase in .NET with the latest version of xUnit, the industry-standard testing library.

    Learn more about From Zero to Hero: Testing with xUnit in C#
    Create a ChatGPT Console AI Chatbot in C#
    blog

    Create a ChatGPT Console AI Chatbot in C#

    This walkthrough is your hands-on entry point to create a basic C# console application that talks to ChatGPT using the OpenAI API.

    Learn more about Create a ChatGPT Console AI Chatbot in C#