惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
Spread Privacy
Spread Privacy
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
SecWiki News
SecWiki News
腾讯CDC
P
Privacy International News Feed
Webroot Blog
Webroot Blog
J
Java Code Geeks
爱范儿
爱范儿
A
About on SuperTechFans
S
Secure Thoughts
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
D
DataBreaches.Net
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Latest
Security Latest
Forbes - Security
Forbes - Security
小众软件
小众软件
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threatpost
量子位
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
S
Security @ Cisco Blogs
T
The Exploit Database - CXSecurity.com
Help Net Security
Help Net Security
V
Visual Studio Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 聂微东
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs

博客园 - Hylix

Nine Million Bicycles 明天8月8号,奥运会进入倒计时一周年! 说说俺的电脑 new pic 在这最艰难的日子里,我一定要挺过! I hava worked for four weeks! 发现自己很盲目! 听说最近华为中兴死了两个人。。。 【zt原创】昨天痛打一本科生的经历!!! Java 和 C# 之间的异同点 (转自MSDN) 毕业啦!!! 近期找工作进程 2005年的最后一天,2005年的第一场大雪! Chinese students in the US: Taking a stand @Nature Don‘t Cry For Me,Argentina 周末泡论坛关键词 人类死而复生不再是梦 动物实验已获成功 今天喝酒 中国有这么一群人
C#面向对象设计模式纵横谈(1):面向对象设计模式与原则
Hylix · 2006-05-09 · via 博客园 - Hylix

以前学过,现在再体会.

模式 设计模式
模式:每一个模式描述了一个在我们周围不断重复发生的问题,以及该解决方案的核心.
设计模式:设计模式描述了软件设计过程中某一类常见问题的一般性解决方案.

对象是什么:
从概念层面讲,对象是某种拥有责任的抽象,
从规格层面讲,对象是一系列可以被其他对象使用的公共接口.
从语言实现层面讲,对象封装了代码和数据.

设计原则
1.针对接口编程,而不是针对实现编程.
2.优先使用对象组合,而不是类继承.
3.封装变化点.
4.使用重构得到模式
更具体原则:
单一职责原则:一个类应该仅有一个引起它变化的原因.
开放封闭原则:类模块应该是扩展的,但是不可修改.
替换原则:子类必须能够替换它的基类.
依赖倒置原则:高层模块不应该依赖于底层模块,二者都应该依赖于抽象.抽象不应该依赖于实现细节,实现细节必须依赖于抽象.
接口隔离原则:不应该强迫客户程序依赖于他们不用的方法.

posted on 2006-05-09 16:34  Hylix   阅读(397)  评论(0)    收藏  举报