为什么你写的代码改不动?

很多初学者写的 C# 程序能跑,但加个需求就牵一发而动全身。这门课解决的核心问题,就是把“能运行的代码”变成“可维护的软件”。它不教你基础语法,而是从 SOLID 原则切入,这是所有设计模式的基石。很多人背得下五大原则的名字,却分不清里氏替换和依赖倒置在实际编码中的区别。课程通过具体的 C# 代码示例,把这些抽象概念落地,让你明白为什么面向接口编程、为什么开闭原则才是扩展性的根本。

适合谁?先看哪几块?

适合有一定 C# 语法基础,但在实际项目中感到架构混乱、代码耦合度高的学习者。不需要你是架构师,但需要你能读懂类和接口。建议学习顺序:先花充足时间攻克“01 The SOLID Design Principles”部分,这是后续所有模式的理解前提。如果这五节没看懂,直接看 Builder 模式只会照搬写法而不懂意图。之后重点学习“02 Builder”,特别是 Fluent Builder 和 Faceted Builder 的实现,这是实际开发中构建复杂对象最常用的模式之一。配套的 .cs 文件不是文档,而是必须动手运行的代码,不要只看不练。

学完能做什么?

学完后,你能够识别现有代码中的设计缺陷,并运用单一职责、依赖倒置等原则进行重构。面对需要大量配置参数的对象创建场景,你能独立实现灵活的建造者模式,而不是堆砌构造函数重载。配套的资料包包含了关键章节的源码文本,建议边看视频边对照修改代码参数,观察运行结果变化。课程还配有 quiz,用来检验你是否真正理解了原则背后的权衡,而不是仅仅记住了定义。通过这套练习,你能建立起从“写代码”到“设计系统”的思维转变,为后续学习更复杂的设计模式打下坚实基础。

课程目录

00 None
001 Introduction.mp4
01 The SOLID Design Principles
002 Overview.mp4
003 Single Responsibility Principle.mp4
004 Open-Closed Principle.mp4
005 Liskov Substitution Principle.mp4
006 Interface Segregation Principle.mp4
007 Dependency Inversion Principle.mp4
008 Summary.mp4
attached_files
003 Single Responsibility Principle
SOLID.SRP.cs.txt
004 Open-Closed Principle
SOLID.OCP.cs.txt
005 Liskov Substitution Principle
SOLID.LSP.cs.txt
006 Interface Segregation Principle
SOLID.ISP.cs.txt
007 Dependency Inversion Principle
SOLID.DIP.cs.txt
02 Builder
009 Overview.mp4
010 Life Without Builder.mp4
011 Builder.mp4
012 Fluent Builder.mp4
013 Faceted Builder.mp4
014 Summary.mp4
011 Builder
Creational.Builder.Builder.cs.txt
013 Faceted Builder
Creational.Builder.BuilderFacets.cs.txt
quizzes
001 Builder Coding Exercise.html
03 Factories
015 Overview.mp4
016 Point Example.mp4
017 Factory Method.mp4
018 Factory.mp4
019 Inner Factory.mp4
020 Abstract Factory.mp4
021 Abstract Factory and OCP.mp4
022 Summary.mp4
016 Point Example
Creational.Factories.Factory.cs.txt
020 Abstract Factory
Creational.Factories.AbstractFactory.cs.txt
002 Factory Coding Exercise.html
04 Prototype
023 Overview.mp4
024 ICloneable is Bad.mp4
025 Copy Constructors.mp4
026 Explicit Deep Copy Interface.mp4
027 Copy Through Serialization.mp4
028 Summary.mp4
024 ICloneable is Bad
Creational.Prototype.ICloneableIsBad.cs.txt
025 Copy Constructors
Creational.Prototype.CopyConstructors.cs.txt
027 Copy Through Serialization
Creational.Prototype.CopyThroughSerialization.cs.txt
003 Prototype Coding Exercise.html
05 Singleton
029 Overview.mp4
030 Singleton Implementation.mp4
031 Testability Issues.mp4
032 Singleton in Dependency Injection.mp4
033 Monostate.mp4
034 Summary.mp4
030 Singleton Implementation
Creational.Singleton.Singleton.cs.txt
032 Singleton in Dependency Injection
Creational.Singleton.SingletonInDI.cs.txt
033 Monostate
Creational.Singleton.Monostate.cs.txt
004 Singleton Coding Exercise.html
06 Adapter
035 Overview.mp4
036 VectorRaster Demo.mp4
037 Adapter Caching.mp4
038 Summary.mp4
036 VectorRaster Demo
Structural.Adapter.NoCaching.cs.txt
037 Adapter Caching
Structural.Adapter.WithCaching.cs.txt
005 Adapter Coding Exercise.html
07 Bridge
039 Overview.mp4
040 Bridge.mp4
041 Summary.mp4
0OO_Softarchive - Download-More-Here.url
0OO_Software.For_Mac0S.txt
0OO_Windows.Office-AD0BE-Visual_Studio 2017.txt
040 Bridge
Structural.Bridge.Bridge.cs.txt
006 Bridge Coding Exercise.html
08 Composite
042 Overview.mp4
043 Geometric Shapes.mp4
044 Neural Networks.mp4
045 Summary.mp4
043 Geometric Shapes
Structural.Composite.GeometricShapes.cs.txt
044 Neural Networks
Structural.Composite.NeuralNetworks.cs.txt
007 Composite Coding Exercise.html
09 Decorator
046 Overview.mp4
047 Custom String Builder.mp4
048 Adapter-Decorator.mp4
049 Multiple Inheritance.mp4
050 Dynamic Decorator Composition.mp4
051 Static Decorator Composition.mp4
052 Summary.mp4
047 Custom String Builder
Structural.Decorator.CodeBuilder.cs.txt
048 Adapter-Decorator
Structural.Decorator.AdapterDecorator.cs.txt
049 Multiple Inheritance
Structural.Decorator.MultipleInheritance.cs.txt
050 Dynamic Decorator Composition
Structural.Decorator.Decorator.cs.txt
008 Decorator Coding Exercise.html
10 Façade
053 Overview.mp4
054 Façade.mp4
055 Summary.mp4
11 Flyweight
056 Overview.mp4
057 Repeating User Names.mp4
058 Text Formatting.mp4
059 Summary.mp4
057 Repeating User Names
Structural.Flyweight.Users.cs.txt
058 Text Formatting
Structural.Flyweight.TextFormatting.cs.txt
009 Flyweight Coding Exercise.html
12 Proxy - Snorgared - SAnet.cd
060 Overview.mp4
061 Protection Proxy.mp4
062 Property Proxy.mp4
063 Dynamic Proxy for Logging.mp4
064 Proxy vs. Decorator.mp4
065 Summary.mp4
061 Protection Proxy
Structural.Proxy.ProtectionProxy.cs.txt
062 Property Proxy
PropertyProxy.cs.txt
063 Dynamic Proxy for Logging
Structural.Proxy.DynamicProxy.cs.txt
010 Proxy Coding Exercise.html
13 Chain of Responsibility - Snorgared - SAnet.cd
066 Overview.mp4
067 Command Query Separation.mp4
068 Method Chain.mp4
069 Broker Chain.mp4
070 Summary.mp4
068 Method Chain
Behavioral.ChainOfResponsibility.MethodChain.cs.txt
069 Broker Chain
Behavioral.ChainOfResponsibility.BrokerChain.cs.txt
011 Chain of Responsibility Coding Exercise.html
14 Command
071 Overview.mp4
072 Command.mp4
073 Undo Operations.mp4
074 Summary.mp4
072 Command
Behavioral.Command.Command.cs.txt
012 Command Coding Exercise.html
15 Interpreter
075 Overview.mp4
076 Handmade Interpreter Lexing.mp4
077 Handmade Interpreter Parsing.mp4
078 ANTLR.mp4
079 Summary.mp4
076 Handmade Interpreter Lexing
Behavioral.Interpreter.Handmade.cs.txt
013 Interpreter Coding Exercise.html
16 Iterator
080 Overview.mp4
081 Iterator Object.mp4
082 Iterator Method.mp4
083 Iterators and Duck Typing.mp4
084 Array-Backed Properties.mp4
085 Summary.mp4
081 Iterator Object
Behavioral.Iterator.TreeTraversal.cs.txt
084 Array-Backed Properties
ArrayBackedProperties.cs.txt
014 Iterator Coding Exercise.html
17 Mediator
086 Overview.mp4
087 Chat Room.mp4
088 Event Broker.mp4
089 Summary.mp4
087 Chat Room
Behavioral.Mediator.ChatRoom.cs.txt
088 Event Broker
RxEventBroker.cs.txt
015 Mediator Coding Exercise.html
18 Memento
090 Overview.mp4
091 Memento.mp4
092 Undo and Redo.mp4
093 Memento for Interop.mp4
094 Summary.mp4
091 Memento
Behavioral.Memento.Memento.cs.txt
092 Undo and Redo
Behavioral.Memento.UndoRedo.cs.txt
19 Null Object
095 Overview.mp4
096 Null Object.mp4
097 Dynamic Null Object.mp4
098 Summary.mp4
096 Null Object
Behavioral.NullObject.NullObject.cs.txt
20 Observer
099 Overview.mp4
100 Observer via the event Keyword.mp4
101 Weak Event Pattern.mp4
102 Observable Properties and Sequences.mp4
103 Summary.mp4
100 Observer via the event Keyword
Behavioral.Observer.Events.cs.txt
101 Weak Event Pattern
Behavioral.Observer.WeakEventPattern.cs.txt
102 Observable Properties and Sequences
ObserverPattern.cs.txt
21 State
104 Overview.mp4
105 Handmade State Machine.mp4
106 State Machine with Stateless.mp4
107 Summary.mp4
105 Handmade State Machine
Behavioral.State.Handmade.cs.txt
106 State Machine with Stateless
Behavioral.State.Stateless.cs.txt
22 Strategy
108 Overview.mp4
109 Dynamic Strategy.mp4
110 Static Strategy.mp4
111 Summary.mp4
109 Dynamic Strategy
Behavioral.Strategy.Dynamic.cs.txt
110 Static Strategy
Behavioral.Strategy.Static.cs.txt
23 Template Method
112 Overview.mp4
113 Template Method.mp4
114 Summary.mp4
113 Template Method
Behavioral.TemplateMethod.TemplateMethod.cs.txt
24 Visitor
115 Overview.mp4
116 Intrusive Expression Printing.mp4
117 Reflection-Based Printing.mp4
118 Classic Visitor Double Dispatch.mp4
119 Dynamic Visitor via the DLR.mp4
120 Summary.mp4
116 Intrusive Expression Printing
Behavioral.Visitor.Intrusive.cs.txt
117 Reflection-Based Printing
Behavioral.Visitor.Reflective.cs.txt
118 Classic Visitor Double Dispatch
Behavioral.Visitor.Classic.cs.txt
119 Dynamic Visitor via the DLR
Behavioral.Visitor.Dynamic.cs.txt
25 Course Summary
121 Creational Paterns Summary.mp4
122 Structural Patterns Summary.mp4
123 Behavioral Patterns Summary.mp4
124 End of Course.mp4
00 None│ 001 Introduction.mp4│
01 The SOLID Design Principles│ │ 002 Overview.mp4│ │ 003 Single Responsibility Principle.mp4│