Today ,I read the chapter one of the Head first design pattern,and i found the book was a exicting book.
now i just want to sum it up.
The chapter one tell us a pattern called Strategy pattern,Frist of all ,we should know the formal
definition of the pattern, Here is it .the Strategy pattern defines a family of algorithms , encapsulate
each one , and makes them interchangeable.do as this , a algorithm will vary independently from the
clients that use it .
The point of this pattern is finding out the changable parts from the system,and encapsulating them
into a independent unit .In the concrete project,what we need to do is finding chang- es and encapsulating
them into a class or a interface.and the client only know the abstract class or interface ,and don't need
take care of the implementments.
This pattern relate to three roles, one is the context part ,another is the abstract strategy part ,and
the rest one is the concrete strategy part .what we need to do just is implement the concrete
strategy ,what'more ,the context don't need to know the concrete implements.Here is the class Diagram
.
This chapte also tell us some oo design principles.As are show here.
1 . identify the aspects of your app that vary and separate them from what stays the same.
2 . Program to interface ,not to implementation.
3 . Favor compositon over inheritance .
分享到:
相关推荐
Head First Design Patterns 中文版 带目录 设计模式经典书籍
又名: Head First Design Patterns 作者: (美)弗里曼(Freeman,E.) 副标题: Head First Design Patterns 简介 ······ 你不想重新发明车轮(或者更差的是,没有充气车胎的轮子),所以你从设计模式中寻求...
Head First Design Patterns(中文版)设计模式 java。 Head First Design Patterns(中文版) 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除 设计模式 ...
深入浅出设计模式(Head First Design Patterns)完整版,由本人精心整理网上的JPG版制作成PDF版供各位编程爱好者下载学习, 这部模式教程诙谐幽默,寓教于乐,实乃菜鸟成才必备之选。共分为11个压缩包,绝对的物有所...
深入浅出设计模式(Head First Design Patterns)完整版,由本人精心整理网上的JPG版制作成PDF版供各位编程爱好者下载学习, 这部模式教程诙谐幽默,寓教于乐,实乃菜鸟成才必备之选。共分为11个压缩包,绝对的物有所...
head first design patterns-head first 设计模式的英文原版;高清英文原版,非扫描
《HeadFirst Design Patterns》是设计模式领域中一本非常受欢迎的入门书籍,以其独特的教学方式深受读者喜爱。设计模式是软件工程中的一种最佳实践,它总结了在特定上下文中解决常见问题的经验和方法,使得开发者...
深入浅出设计模式(Head First Design Patterns)完整版,由本人精心整理网上的JPG版制作成PDF版供各位编程爱好者下载学习,这部模式教程诙谐幽默,寓教于乐,实乃菜鸟成才必备之选。共分为9个压缩包,绝对的物有所值...
### Head First Design Patterns 英文版 #### 书籍概述 《Head First Design Patterns》是一本在软件开发领域广受好评的设计模式入门书籍。本书由Kathy Sierra与Bert Bates共同编写,采用了一种独特而富有创意的...
《Head First Design Patterns》是设计模式领域中一本非常知名的书籍,尤其适合初学者入门。这本书以其独特的视觉风格和易于理解的讲解方式,帮助读者深入理解设计模式的核心概念和实际应用。Part2部分主要涵盖了...
“Great code design is, first and foremost, great information design. A code designer is teaching a com- puter how to do something, and it is no surprise that a great teacher of computers should turn ...
《Head First Design Patterns》是一本深入浅出介绍设计模式的图书,由Eric Freeman、Elisabeth Freeman、Bert Bates和Kathy Sierra联合编写。本书结合认知科学原理和神经生物学研究,采用引导式教学方法,通过故事...
HeadFirst Design Pattern in C#
深入浅出设计模式(Head First Design Patterns)完整版,由本人精心整理网上的JPG版制作成PDF版供各位编程爱好者下载学习,这部模式教程诙谐幽默,寓教于乐,实乃菜鸟成才必备之选。共分为9个压缩包,绝对的物有所值...
这本书的部分章节,即"Pages from Head First Design Patterns (英文高清版)_part1.rar",可能涵盖了以下几个主要的设计模式: 1. **工厂模式**:工厂模式是一种创建型设计模式,它提供了一种创建对象的最佳方式,...
head first design patterns电子版本(第1部分)
软件设计模式中文版 &head; first python 。
本书作者Eric Freeman;ElElisabeth Freeman是作家、讲师和技术顾问。本书的产品设计应用神经生物学、认知科学,以及学习理论,这使得这本书能够将这些知识深深地印在你的脑海里,不容易被遗忘。...
Your brain on Design Patterns. Here you are trying to learn something, while here your brain is doing you a favor by making sure the learning doesn’t stick. Your brain’s thinking, “Better leave ...