![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Design
文章平均质量分 89
Ivar_PredixCN
这个作者很懒,什么都没留下…
展开
-
学习设计模式之State
[size=x-large][b]发现问题:[/b][/size]大家在Coding的时候,有没有用到很多的选择语句?像这样: [code="java"]if(…){ …}else if(…){ …}else if(…){ …}else{ …}[/code]我是经常碰...2008-07-08 01:22:27 · 92 阅读 · 0 评论 -
实现自己的可重用拦截器机制
AOP技术是spring框架的一个重要特征。通过该特性能够在[b]函数运行之前,之后,或者异常处理的时候[/b]执行我们需要的一些操作。下面我们就是需要抛开AOP,Spring这样成型的框架不用,而仅仅使用java反射机制中的Proxy,InvocationHandler来实现类似Spring框架的拦截器的效果。[b][size=xx-large]动态代理DynamicProxy[...2008-08-30 17:06:09 · 123 阅读 · 0 评论 -
讨论一下CQS (命令-查询 分离)原则
:D 看Craig Larman的书,里面提到的这个原则.请看下面两个函数:[code="java"]// style #1; used in the official solutionpublic void roll(){ faceValue = // random num generation}public int getFaceVal...2008-12-24 17:50:50 · 803 阅读 · 0 评论 -
代理模式学习笔记
Proxy Pattern IntentProvide a surrogate or placeholder for another object to control access to it.代理模式为另一个对象提供替身或者占位符以控制对这个对象的访问. 使用代理模式创建代表(Representative)对象, 让代表对象控制对象的访问, 被代理的对象可以是远程的...原创 2009-08-10 13:42:58 · 86 阅读 · 0 评论 -
通用职责分配软件模式(GRASP)学习笔记(一)
通用职责分配软件模式General Responsibility Assignment Software PatternsUnderstanding responsibilities is key to good object-oriented design.--Martin FowlerGRASP 定义了9个基本的OO设计原则或基本设计构件.There are nine GR...2009-08-31 09:52:51 · 248 阅读 · 0 评论 -
通用职责分配软件模式(GRASP)学习笔记(二)
多态 PolymorphismProblem:How to handle alternative based on types? 如何处理基于变化的类型?How to create pluggable software components? 如何创建可插拔的组建?Alternatives based on type Conditional variation is a fun...2009-08-31 09:58:31 · 350 阅读 · 0 评论 -
One of the Best Bits of Programming Advice I ever Got
from: http://objology.blogspot.com/2011/09/one-of-best-bits-of-programming-advice.html Years ago (early 1992), I attached myself to this crazy skunkworks project that was using this weird langua...原创 2011-11-28 20:31:00 · 134 阅读 · 0 评论