没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Table of Contents
Chapter 1. Welcome to Design Patterns....................................................... 1
Section 1.1. It started with a simple SimUDuck app....................................................................................................................... 2
Section 1.2. But now we need the ducks to FLY............................................................................................................................. 3
Section 1.3. But something went horribly wrong........................................................................................................................... 4
Section 1.4. Joe thinks about inheritance....................................................................................................................................... 5
Section 1.5. Sharpen your pencil..................................................................................................................................................... 5
Section 1.6. How about an interface?............................................................................................................................................. 6
Section 1.7. What would you do if you were Joe?........................................................................................................................... 7
Section 1.8. The one constant in software development................................................................................................................ 8
Section 1.9. Sharpen your pencil.................................................................................................................................................... 8
Section 1.10. Zeroing in on the problem......................................................................................................................................... 9
Section 1.11. Separating what changes from what stays the same............................................................................................... 10
Section 1.12. Designing the Duck Behaviors.................................................................................................................................. 11
Section 1.13. Implementing the Duck Behaviors.......................................................................................................................... 13
Section 1.14. There are no Dumb Questions................................................................................................................................. 14
Section 1.15. Sharpen your pencil.................................................................................................................................................. 14
Section 1.16. Integrating the Duck Behavior................................................................................................................................. 15
Section 1.17. More Integration...................................................................................................................................................... 16
Section 1.18. Testing the Duck code.............................................................................................................................................. 18
Section 1.19. Setting behavior dynamically.................................................................................................................................. 20
Section 1.20. The Big Picture on encapsulated behaviors............................................................................................................ 22
Section 1.21. HAS-A can be better than IS-A................................................................................................................................ 23
Section 1.22. Speaking of Design Patterns................................................................................................................................... 24
Section 1.23. Design Puzzle........................................................................................................................................................... 25
Section 1.24. Overheard at the local diner.................................................................................................................................... 26
Section 1.25. Overheard in the next cubicle.................................................................................................................................. 27
Section 1.26. The power of a shared pattern vocabulary............................................................................................................. 28
Section 1.27. How do I use Design Patterns?............................................................................................................................... 29
Section 1.28. There are no Dumb Questions................................................................................................................................ 29
Section 1.29. Skeptical Developer-Friendly Patterns Guru......................................................................................................... 30
Section 1.30. Tools for your Design Toolbox................................................................................................................................ 32
Section 1.31. Design Puzzle Solution............................................................................................................................................ 34
Section 1.32. Solutions.................................................................................................................................................................. 35
Chapter 1. Welcome to Design Patterns
Chapter 1. Welcome to Design Patterns
Head First Design Patterns By Eric Freeman, Elisabeth Freeman, Bert Bates, Kathy Sierra
ISBN: 0596007124 Publisher: O'Reilly
Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2004/10/25 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
www.it-ebooks.info
WKLVLVDQHZFKDSWHU
6RPHRQHKDVDOUHDG\VROYHG\RXUSUREOHPV,QWKLVFKDSWHU\RX¶OOOHDUQ
ZK\DQGKRZ\RXFDQH[SORLWWKHZLVGRPDQGOHVVRQVOHDUQHGE\RWKHUGHYHORSHUVZKR¶YH
EHHQGRZQWKHVDPHGHVLJQSUREOHPURDGDQGVXUYLYHGWKHWULS%HIRUHZH¶UHGRQHZH¶OO
ORRNDWWKHXVHDQGEHQH¿WVRIGHVLJQSDWWHUQVORRNDWVRPHNH\22GHVLJQSULQFLSOHVDQG
ZDONWKURXJKDQH[DPSOHRIKRZRQHSDWWHUQZRUNV7KHEHVWZD\WRXVHSDWWHUQVLVWRORDG
\RXUEUDLQZLWKWKHPDQGWKHQUHFRJQL]HSODFHVLQ\RXUGHVLJQVDQGH[LVWLQJDSSOLFDWLRQV
ZKHUH\RXFDQDSSO\WKHP,QVWHDGRIFRGHUHXVHZLWKSDWWHUQV\RXJHWH[SHULHQFHUHXVH
:HOFRPHWR
'HVLJQ3DWWHUQV
Intro to Design Patterns
1RZWKDWZH·UHOLYLQJ
LQ2EMHFWYLOOHZH·YHMXVWJRW
WRJHWLQWR'HVLJQ3DWWHUQV
HYHU\RQHLVGRLQJWKHP6RRQ
ZH·OOEHWKHKLWRI-LPDQG
%HWW\·V:HGQHVGD\QLJKW
SDWWHUQVJURXS
4
5
4
Chapter 1. Welcome to Design Patterns Page 1 Return to Table of Contents
Chapter 1. Welcome to Design Patterns
Head First Design Patterns By Eric Freeman, Elisabeth Freeman, Bert Bates, Kathy Sierra
ISBN: 0596007124 Publisher: O'Reilly
Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2004/10/25 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
www.it-ebooks.info
&KDSWHU
1\[\IZ\ML_Q\PI[QUXTM;QU=,]KSIXX
2WM_WZS[NWZIKWUXIVa\PI\UISM[IPQOPTa[]KKM[[N]TL]KSXWVL
[QU]TI\QWVOIUM;QU=,]KS<PMOIUMKIV[PW_ITIZOM^IZQM\aWN
L]KS[XMKQM[[_QUUQVOIVLUISQVOY]IKSQVO[W]VL[<PMQVQ\QIT
LM[QOVMZ[WN \PM[a[\MU][ML[\IVLIZL77\MKPVQY]M[IVLKZMI\ML
WVM,]KS[]XMZKTI[[NZWU_PQKPITTW\PMZL]KS\aXM[QVPMZQ\
'XFN
TXDFN
VZLP
GLVSOD\
27+(5GXFNOLNHPHWKRGV
GLVSOD\^
ORRNVOLNHDPDOODUG`
0DOODUG'XFN
GLVSOD\^
ORRNVOLNHDUHGKHDG`
5HGKHDG'XFN
/RWVRIRWKHUW\SHVRIGXFNV
LQKHULWIURPWKH'XFNFODVV
(DFKGXFNVXEW\SH
LVUHVSRQVLEOHIRU
LPSOHPHQWLQJLWVRZQ
GLVSOD\EHKDYLRU
IRUKRZLWORRNVRQ
WKHVFUHHQ
$OOGXFNVTXDFNDQGVZLPWKH
VXSHUFODVVWDNHVFDUHRIWKH
LPSOHPHQWDWLRQFRGH
1V\PMTI[\aMIZ\PMKWUXIVaPI[JMMV]VLMZQVKZMI[QVOXZM[[]ZM
NZWUKWUXM\Q\WZ[)N\MZI_MMSTWVOWNN[Q\MJZIQV[\WZUQVO
[M[[QWVW^MZOWTN\PMKWUXIVaM`MK]\Q^M[\PQVSQ\¼[\QUMNWZIJQO
QVVW^I\QWV<PMaVMML[WUM\PQVOZMITTaQUXZM[[Q^M\W[PW_I\\PM
]XKWUQVO[PIZMPWTLMZ[UMM\QVOQV5I]QVM`\_MMS
7KHGLVSOD\PHWKRGLV
DEVWUDFWVLQFHDOOGXFN
VXEW\SHVORRNGLIIHUHQW
6LP8'XFN
Chapter 1. Welcome to Design Patterns Page 2 Return to Table of Contents
Chapter 1. Welcome to Design Patterns
Head First Design Patterns By Eric Freeman, Elisabeth Freeman, Bert Bates, Kathy Sierra
ISBN: 0596007124 Publisher: O'Reilly
Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2004/10/25 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
www.it-ebooks.info
LQWURWR'HVLJQ3DWWHUQV
\RXDUHKHUH
-RH
,MXVWQHHGWRDGGDÁ\
PHWKRGLQWKH'XFNFODVVDQG
WKHQDOOWKHGXFNVZLOOLQKHULWLW
1RZ·VP\WLPHWRUHDOO\VKRZP\
WUXH22JHQLXV
$OOVXEFODVVHV
LQKHULWIO\
:KDW-RHDGGHG
<PMM`MK]\Q^M[LMKQLML\PI\ÆaQVOL]KS[Q[R][\_PI\\PM
[QU]TI\WZVMML[\WJTW_I_Ia\PMW\PMZL]KS[QUKWUXM\Q\WZ[
)VLWN KW]Z[M2WM¼[UIVIOMZ\WTL\PMUQ\¼TTJMVWXZWJTMU
NWZ2WM\WR][\_PQX[WUM\PQVO]XQVI_MMS¹)N\MZITTº[IQL
2WM¼[JW[[¹PM¼[IV77XZWOZIUUMZPW_PIZLKIVQ\JM'º
*]\VW__MVMML\PML]KS[\W.4A
2WKHU'XFNW\SHV
'XFN
TXDFN
VZLP
GLVSOD\
IO\
27+(5GXFNOLNHPHWKRGV
GLVSOD\^
ORRNVOLNHDPDOODUG`
0DOODUG'XFN
GLVSOD\^
ORRNVOLNHDUHGKHDG`
5HGKHDG'XFN
:KDWZHZDQW
Chapter 1. Welcome to Design Patterns Page 3 Return to Table of Contents
Chapter 1. Welcome to Design Patterns
Head First Design Patterns By Eric Freeman, Elisabeth Freeman, Bert Bates, Kathy Sierra
ISBN: 0596007124 Publisher: O'Reilly
Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2004/10/25 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
www.it-ebooks.info
剩余618页未读,继续阅读
资源评论
tonsz
- 粉丝: 15
- 资源: 33
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功