
Explore encapsulation as hiding object details and exposing essential information through properties or getters and setters, enabling clients to use systems without knowing internal workings, like cars or search engines.
Learn how poor code harms maintainability and slows projects, as empathy improves readability and API clarity, reducing time spent deciphering methods.
Explore empathetic code by contrasting a csv manager example with non-empathetic methods, clarifying save and read behaviors, return values, and how the event informs csv data processing under solid principles.
Explore the command query separation principle: design methods as either commands that perform actions or queries that return data, but not both, per Bertrand Major's Object Oriented Software Construction.
Identify the read-only, idempotent nature of query operations that return data without changing state, using C# examples and Visual Studio context. Rename parameters for clarity and separate queries from commands.
Identify commands such as save, log, and delete as operations that modify the system state. Contrast them with queries that return data, and note the get file path method.
Create robust input validation by enforcing preconditions in constructors, restricting access to fields with private setters, and using protection classes to ensure valid CSV folder paths and descriptive messages.
Explore robust output handling in C# by comparing tester doer, try read, and maybe patterns to read files safely, avoid nulls, and support single results in multithreaded contexts.
Learn about the SOLID principles—SRP, OCP, LSP, ISP, and DP—and how applying them together improves code reuse, robustness, and testability through practical examples.
Study the single responsibility principle and the concepts of coupling and cohesion, then learn to minimize coupling and maximize cohesion, using Visual Studio code metrics.
Explain cohesion as how a class's fields and methods fit together. Show how splitting a class into printer and logger improves cohesion and aligns with the single responsibility separation principle.
Explains the single responsibility principle by contrasting coupling and cohesion, showing how modules should change for a single reason and isolating roles in a reporting example.
Apply the SRP principle by introducing a dedicated logger and an info reader to separate logging and file reading from the report engine.
Understand how the open-closed principle lets you extend behavior without modifying code, using inheritance, interfaces, dependency injection, and extension methods to reduce bugs and api conflicts.
Apply the open closed principle by refactoring affiliate calculations with a base calculator and concrete classes (basic, silver, gold, diamond) and a calculator factory that uses reflection for instance creation.
Explore the Liskov substitution principle, showing subtypes substitutable for base types via the rectangle and square example and polymorphism, and avoid violations like type checks and not implemented exceptions.
Apply the Liskov Substitution Principle by returning a non-null unknown affiliate instance in the factory for undefined types and log the unknown affiliate type.
Explains the interface segregation principle, showing how dividing large interfaces into smaller ones prevents unused methods, illustrated by a sender interface for email and SMS and an adapter approach.
Apply the interface segregation principle by splitting a fat media file interface into focused interfaces like opener and image, ensuring each class implements only relevant methods and improves cohesion.
Learn how the dependency inversion principle reduces coupling by having high level modules depend on abstractions rather than concrete implementations, illustrated with IPrinter and IConnection interfaces in C#.
Apply the dependency inversion principle by extracting interfaces, centralizing instance creation with a factory, and using constructor injection to decouple concerns, improving testability and flexibility.
Discover how design patterns describe recurring problems and provide reusable solutions, tracing origins to Christopher Alexander and influencing software engineering through Ward Cunningham, Kent Beck, and the Gang of Four.
Explore how a design pattern is composed by examining its intention, motivation, scenario, structure, and example code, with catalogs detailing relationships and implementation steps.
Explore the factory method pattern, defining an interface for object creation while letting subclasses decide what to instantiate. See how it defers instantiation to subclasses to solve the design problem.
The factory method decouples the Forex class from concrete processors by delegating creation to a factory and using a predict interface for Bitcoin and Ethereum, supporting open-closed and single-responsibility principles.
Learn how the simple factory pattern defines a product interface and concrete processors, with a factory that creates the right processor to predict cryptocurrency data.
Explore the factory method pattern that defines an abstraction for concrete products and uses a creator class with a factory method to instantiate Bitcoin and Ethereum processors.
Learn how the factory method design pattern creates concrete cryptocurrency processors like Ethereum and Bitcoin via an abstract processor factory and overridden create processor methods, enabling customization.
Explore the abstract factory design pattern, clarifying how it provides an interface for creating families of related objects without specifying their concrete classes, and distinguish it from the factory method.
Explore the abstract factory pattern across three control families—material design, Cupertino, and Fluent UI—using interfaces like the I button and the I textbox, and learn about factory of factories.
Analyze the abstract factory structure by defining product abstractions and concrete implementations, forming two families. A client uses a factory abstraction to create material and Cupertino buttons and text boxes.
Demonstrate the abstract factory pattern by implementing Cupertino and Fluent UI factories that create buttons and text boxes through a shared interface, replacing a switch-based design.
Explore the builder design pattern and learn how it separates construction of a complex object from its representation, enabling the same process to produce different representations.
Motivate the builder pattern by separating construction of a complex Word document object from its representation, guiding a framework that converts document elements into text or audio outputs.
Explore the builder pattern structure and series of product representations. Define an abstraction with build steps, concrete builders for text file and audio file, and a director to orchestrate creation.
Apply the builder pattern in a C# project by defining a public media converter interface and concrete text and audio converters, orchestrated by the Word Reader class to assemble files.
Welcome to "Mastering SOLID Principles and Classic Design Patterns," a comprehensive course meticulously curated for C# developers. Guided by Microsoft MVP and veteran software developer Hector Perez, this course aims to instill the foundational understanding of SOLID principles and classic design patterns, thereby elevating your coding skills to new heights.
SOLID Principles and Classic Design Patterns are key to producing clean, modular, and maintainable code, forming the bedrock of best software development practices. You'll gain a firm understanding of the five SOLID principles — Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. We'll walk you through their applications, elucidating how to leverage these principles to foster code cleanliness and maintainability.
This course also provides an in-depth exploration of the 23 classic design patterns propounded by the Gang of Four, segmented into Creational, Structural, and Behavioral patterns. Each pattern is a solution to a unique design issue, enhancing code reusability and fostering software that is comprehensible, scalable, and maintainable.
Complementing theoretical learning, this course features extensive coding demonstrations to help cement your understanding of SOLID principles and design patterns. These demos are readily available for download, facilitating hands-on learning at your preferred pace.
By the conclusion of this course, you will have mastered the SOLID principles and the Gang of Four's design patterns, empowering you to produce efficient, maintainable, and scalable code. The curriculum covers a wide range of topics, including introductions to SOLID principles and Gang of Four design patterns, and deep dives into Creational, Structural, and Behavioral patterns.
To ensure an optimal learning experience, a rudimentary knowledge of software development and object-oriented programming is recommended. Embark on this journey to become a proficient C# developer, adept at modern software development with SOLID principles and Gang of Four design patterns. We're eager to see you in the course!