摘要:
1.静态工厂通过静态方法创建对象,但是不符合OCP Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 public class StaticFactory 2 3 { 4 5 public static Book Cr... 阅读全文
摘要:
定义: The software architecture of a program or computing system is the structure or structures of the system, which comprise software components, the externally visible properties of those components, ... 阅读全文
摘要:
1. Constructor Injection public class Boy { private IDog smallDog; public Boy(IDog smallDog) { this.smallDog = smallDog; } } public interface ID... 阅读全文
摘要:
依赖注入三种类型: Constructor Injection; Setter Injection; Interface Injection; 阅读全文
摘要:
who says? 阅读全文
摘要:
The implementation of a non-virtual method is invariant: The implementation is the same whether the method is invoked on an instance of the class in which it is declared or an instance of a derived cl... 阅读全文
摘要:
在C# 多层继承中,如果创建子类,实际上同时也创建了基类对象。 阅读全文
摘要:
多态: 1 public class Women 2 { 3 public void DoWork() { } 4 } 5 6 public class Girl : Women 7 { 8 public new void DoWork() { } 9 } 10 11 class Main 12 { 13 static void Main() ... 阅读全文