随笔分类 - 设计模式
摘要:Understanding the need of Visitor Pattern The visitor pattern is a solution to a more general design problem: I have a hierarchy of different classes.
阅读全文
摘要:Visitor Design Pattern Intent Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation w
阅读全文
摘要:Template Method Design Pattern Rules of thumb Strategy is like Template Method except in its granularity粒度. Template Method uses inheritance to vary p
阅读全文
摘要:What is the difference between the template method and the strategy patterns? The main difference between the two is when the concrete algorithm is ch
阅读全文
摘要:中介者模式 中介者模式(Mediator Pattern)是用来降低多个对象和类之间的通信复杂性。这种模式提供了一个中介类,该类通常处理不同类之间的通信,并支持松耦合,使代码易于维护。中介者模式属于行为型模式。 介绍 意图:用一个中介对象来封装一系列的对象交互,中介者使各对象不需要显式地相互引用,从
阅读全文
摘要:Explanation of the UML arrows https://www.cnblogs.com/chucklu/p/10623671.html 想要学习设计模式,你得先会看类图,一张图读懂UML 虚线箭头指向依赖dependency; 实线箭头指向关联associate; 虚线三角指向接
阅读全文
摘要:https://csharpindepth.com/Articles/Singleton 懒汉,饿汉,以及双层锁之外 Fourth version - not quite as lazy, but thread-safe without using locks public sealed class
阅读全文
摘要:http://www.runoob.com/design-pattern/facade-pattern.html 外观模式 外观模式(Facade Pattern)隐藏系统的复杂性,并向客户端提供了一个客户端可以访问系统的接口。这种类型的设计模式属于结构型模式,它向现有的系统添加一个接口,来隐藏系统
阅读全文
摘要:What are the differences between Flyweight and Object Pool patterns? They differ in the way they are used. Pooled objects can simultaneously be used b
阅读全文
摘要:https://stackoverflow.com/questions/49002/prefer-composition-over-inheritance 解答1 Prefer composition over inheritance as it is more malleable / easy t
阅读全文
摘要:https://www.codewars.com/kata/patterncraft-decorator/train/csharp https://www.dofactory.com/net/decorator-design-pattern
阅读全文
摘要:Patterns in the Composite Application Library Inversion of Control https://www.codeproject.com/Articles/29271/Design-pattern-Inversion-of-control-and-
阅读全文
摘要:#region Assembly Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35// F:\CodeFor91\ZBMYUN20\WebAPP\Source\
阅读全文
摘要:原型模式 http://www.cnblogs.com/zhili/p/PrototypePattern.html ICloneable接口 https://msdn.microsoft.com/en-us/library/system.icloneable(v=vs.110).aspx Suppo
阅读全文
摘要:http://www.cnblogs.com/cbf4life/archive/2009/12/15/1624435.html
阅读全文
摘要:https://msdn.microsoft.com/en-US/library/aa970850(v=vs.100).aspxIn applications, it is possible that handlers that are attached to event sources will ...
阅读全文
摘要:http://www.cnblogs.com/lzhlyle/p/4696645.html 如题,实际上,我想这是很困难的。 除非——只是为了给自己做一个提醒,能够看一眼就快速回想起该设计模式的种种记忆。 下列是我之前在学习《大话设计模式》时做的笔记总结,当中有部分措辞来自其作者程杰。(非常感谢他为
阅读全文
摘要:Here are three short phrases to help remember the 23 design patterns, ordered by category: Creational Patterns: "Abstract Building Factories Produce S
阅读全文
摘要:http://www.codeproject.com/Articles/42415/Builder-Design-Pattern In Elizabeth's day care center, the teacher helps the kids to build all kinds of toys
阅读全文
摘要:.net中的线程池ThreadPool还有和数据库交互的连接池,比如SQL Server Connection Pooling (ADO.NET)https://msdn.microsoft.com/en-us/library/8xx3tyca.aspxSQL Server Connection P...
阅读全文