博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Intro to Design Patterns Study Note
阅读量:6964 次
发布时间:2019-06-27

本文共 881 字,大约阅读时间需要 2 分钟。

No matter what you work, what you're building, or what language you are programming in, what's the one true constant that will be with you always ? -- CHANGE

Design Principle  

  1. Identify the aspects of your application that vary and separate them from what stays the same. (从应用程序不变的部分中抽离变化的部分,这样可以只对变化的部分进行改进或者扩展,而不会影响其它不变的部分)
  2. Program to an interface, not an implementation. (借口编程,而非实现编程) 
  3. Favor composition over inheritance. (相对接口,优先选择组成)

OO Basics

  1. Abstraction
  2. Encapulation
  3. Polymorphism
  4. Inheritance

OO Principles

  1. Encapsulate what varies
  2. Favor composition over inheritence
  3. Program to interfaces, not implementations.

OO Patterns

  The Strategy Pattern defines a family of algorithms, encapsulates each one, and make them interchangeable.  <br/>Strategy lets the algorithm vary independently from clients that use it.

转载于:https://www.cnblogs.com/geroge-code/archive/2012/08/27/2658091.html

你可能感兴趣的文章
微软云计算介绍与实践(介绍之二)
查看>>
分布式系统
查看>>
笔记素材
查看>>
Ubuntu 杂项
查看>>
linux下安装完oracle后字符问题
查看>>
博为峰Java面试题-Java 面向对象
查看>>
如何安装Node.js
查看>>
linux系统优化(实践篇)
查看>>
跟小博老师一起学习数据库 ——外连接
查看>>
在LINUX下探测硬件信息的命令
查看>>
cisco ASA 551X系列防火墙限速
查看>>
经典游戏服务器端架构概述 (1)
查看>>
【iOS-Cocos2d游戏开发之十四】音频、音效播放+Cocos2D-Extensions视频播放!
查看>>
一个简单的JavaBean分页操作
查看>>
Linux系统有啥好的,你们都去学?
查看>>
利用碎片化时间Get Linux系统
查看>>
虚拟胡--001 powercli安装遇到问题about_Execution_Policie-remotesign
查看>>
老司机带你攻破微信消息防撤回功能
查看>>
android shape的使用
查看>>
我的友情链接
查看>>