`

One onte of Head first design patterns(Observer pattern)

阅读更多

I read the chapter two of  Head first design pattern just now,next ,i will just make a record.

        This chapter tells us how to use the observer pattern.after read it ,i realized that   the

observer pattern is very important and usefull to us .now i will sum it up .

        The observer pattern is used in the following condition.when our system contains a

one -to- many  dependency between objects,what'more,it is necessary that the change of

one object 'state  will make all of the dependents notified and updataed.here is the formal

definition of the observer pattern:The observer pattern defines a one-to-may dependency

among objects so that when one object changes state,all of its dependents are    notified

and updataed automatically.

       Next,i will sum up the characters of the observer pattern.the subject part,the abstract

observer,the concrete subject and the concrete observer.

      This pattern shows up server oo design principles.here are they .

      1 indentify the aspects of your app that vary and separate them from what stays    the 

 same . in the pattern,what vary are the state of the subject and the number of the observer.

 with this pattern,the things vary are well  encapsulated.

     2 programe to interface ,not to implementation.

     3 favor composition than inheritance.

分享到:
评论

相关推荐

    邮件辐照系统屏蔽的 M onte Carlo计算 (2004年)

    为评价电子束邮件辐照系统的屏蔽设计,采用Monte Carlo程序包 EGSWIN系统以及 MCNP4C,对屏蔽计算的方法进行了研究。针对深穿透问题,提出了等效算法。利用 EGSWIN对电子束打铝板所产生韧致辐射的能谱、方向和强度进行...

    基于 FORM的 M onte Carlo精度修正可靠度算法 (2004年)

    结构可靠度分析的核心是计算预定义功能函数的失效概率。提出一种基于一次可靠度算法(FORM)计算结果的 Monte Carlo精度修正可靠度算法,它将原可靠度列式转换为一个求旋转坐标系下 n- 1元函数的统计均值问题,统计均值...

    直接 M onte Carlo方法研究二维平面蒸发原子速度分布 (2002年)

    蒸气原子的速度分布是一个基本的函数,为了研究蒸气原子的速度分布情况,该文采用直接 Monte Carlo法模拟钆原子蒸发过程,给出了 Knudsen层和外部膨胀区的蒸气原子速度分布,进一步研究了亚稳态原子消激发过程对蒸气原子...

    基于 M onte-Carlo实验的 PID参数整定比较方法 (2002年)

    研究了参数在有界区域内变动的热工过程比例微分积分(PID)控制系统的性能比较和参数选优问题。针对热工过程的特点,基于 Monte-Carlo实验原理,以过渡过程品质为指标,提出了一种 PID控制系统鲁棒性及性能的比较研究方法...

    红米note2维修原理图PCB位置图(PDF格式)

    红米note2维修原理图PCB位置图(PDF格式),是维修图,有PCB位置图,是PDF格式的,可用来维修手机,学习手机原理等。有些图纸有些页可能有残缺。

    非高斯荷载作用下结构首次失效时间分析的M onte C arlo 模拟方法 (2007年)

    利用结构反应的头四阶矩,基于Winterstein变换,模拟非高斯荷载作用下结构的反应过程,并由结构反应过程的样本函数,建立了结构首次失效时间分析的模拟方法。二次力函数激励下线性SDOF系统的首次失效时间分析,说明...

    基于故障树的电力变压器维修周期的仿真分析

    针对变压器可靠性数据相对缺乏的特点,提出了一种依据设备基本部件的维修信息,运用M onte2Carlo 算法和故障树原理,据任务可靠度来确定维修周期的仿真算法。这种依据局部维修信息来决策维修周期的方法适应设备的状态...

    金属原子二维平面蒸发动力学过程的数值模拟 (1999年)

    金属蒸发产生原子束技术在材料科学、超导及光学器件,特别是原子激光同位素分离中得到充分应用。为分析激光分离同位素中电子枪加热金属高温...关于空间自由蒸发的研究结果与采用M onte Carlo方法模拟的结果符合得很好。

    考虑电荷交换的RF共振离子引出方法的模拟 (2000年)

    等离子体中带电粒子在电磁场中的运动用P IC方法模拟,而各粒子间的碰撞用M onte Carlo方法来模拟,碰撞类型主要考虑对目标同位素离子损失影响最大的电荷交换。模拟得出了离子引出时间和碰撞损失率与引出系统的各种参数...

Global site tag (gtag.js) - Google Analytics