网上这个相关内容有很多,但是大都说的太复杂了,所以这里我想用一篇来对这六个原则做以概括和总结,1、单一职责原则(SRP:Single Responsibility Principle)...
分类:
其他好文 时间:
2015-04-01 23:53:26
阅读次数:
165
问题:
一个类,只有一个引起它变化的原因。应该只有一个职责。每一个职责都是变化的一个轴线,如果一个类有一个以上的职责,这些职责就耦合在了一起。这会导致脆弱的设计。当一个职责发生变化时,可能会影响其它的职责。另外,多个职责耦合在一起,会影响复用性。例如:要实现逻辑和界面的分离。
好处:
类的复杂性降低。
类的复用性变高。
可读性、可维护性高。...
分类:
其他好文 时间:
2015-04-01 22:03:39
阅读次数:
123
http://www.cnblogs.com/eddyshn/archive/2009/11/23/1608823.htmlVC编译选项 多线程(/MT)多线程调试(/MTd)多线程 DLL (/MD)多线程调试 DLL (/MDd)C 运行时库 库文件Single thread(static li...
分类:
其他好文 时间:
2015-04-01 19:22:11
阅读次数:
145
logstash中的类型
array
boolean
bytes
codec
hash
number
password
path
string
arrayAn array can be a single string value or multiple values. If you specify the same setting multiple times, it appends to the...
分类:
其他好文 时间:
2015-04-01 17:38:19
阅读次数:
161
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the entire input...
分类:
其他好文 时间:
2015-04-01 15:30:32
阅读次数:
153
Nim is a 2-player game featuring several piles of stones. Players alternate turns, and on his/her turn, a player’s move consists of removing one or more stones from any single pile. Play ends when all the stones have been removed, at which point the last p...
分类:
其他好文 时间:
2015-04-01 15:21:45
阅读次数:
197
存在一个数组,该数组中仅有一个数仅出现了一次,其他所有数均出现两次,求这个数 思路:任何一个数和自身求异或操作都是0,任何一个数和0求异或操作都是它自身 class Solution {public: int singleNumber(int A[], int n) { int res=0; for...
分类:
其他好文 时间:
2015-04-01 14:58:29
阅读次数:
124
原文:http://www.codeceo.com/article/23-design-parttens-single-partten.html定义:确保一个类只有一个实例,而且自行实例化并向整个系统提供这个实例。类型:创建类模式类图:类图知识点:1.类图分为三部分,依次是类名、属性、方法2.以>结...
分类:
其他好文 时间:
2015-04-01 12:56:09
阅读次数:
87
下载Sublime Text
链接
http://www.sublimetext.com/3
我下载的是win32 portable 版 便于放入U盘携带
解压
注册: 可以复制以下部分直接贴入注册栏
----- BEGIN LICENSE -----
K-20
Single User License
EA7E-940129
3A099EC1 C0B5C7C5 33EBF0CF BE...
分类:
其他好文 时间:
2015-04-01 07:04:23
阅读次数:
189
LeetCode #Single Number#
刚背了单词,然后做个题玩玩~挑个软柿子踩踩~哈哈
很简单的思路.不过好玩的是我忘记检查处理完的数据是否符合整形数据返回了.因而好一会儿不能AC.
感谢 @Fantasy. 很快的指出我没有检查返回数据的范围.
先给出我超丑陋的解(python), 而后给出其他高手给出的很优雅的解!!也是用pyth...
分类:
其他好文 时间:
2015-04-01 00:24:47
阅读次数:
138