| |
| |
| |
内容简介 设计模式已经成为面向对象设计和编程的主要内容,它为解决我们经常遇到的编程问题提供了易于复用而且可维护的高级方案。然而,许多工作繁忙的Java程序员还没能抽出时间来学习设计模式,也未将这种强大的技术运用到自己的工作中。 本书正是你所需的教程。它采用了方便而简洁的编写风格,能够帮助你理解设计模式的本质和目的。另外它还为使用设计模式来创建复杂而健壮的Java程序提供了实践参考。 本书介绍了Gamma、Helm、Johnson和Vlissides合著的畅销书《设计模式》中列出的23种模式。在本书中,对于每一种模式,都至少为之提供了一个完整的可视化Java程序。通过这种实践方式将使你能够?咛濉⒏崴傻卣莆丈杓颇J降母拍睿笿ava程序员迅速上手,并有助于在实践中充分享用设计模式的强大功能。
| |
|
顾客评论 |
|
目录 Preface Acknowledgments Section?1??What?Are?Design?Patterns? Chapter?1??Introduction Defining?Design?Patterns The?Learning?Process Studying?Design?Patterns Notes?on?Object-Oriented?Approaches The?Java?Foundation?Classes Java?Design?Patterns Chapter?2??UML?Diagrams Inheritance Interfaces Composition Annotation JVISION?UML?Diagrams Visual?SlickEdit?Project?Files Section?2??Creational?Patterns Chapter?3??The?Factory?Pattern How?a?Factory?Works Sample?Code The?Two?Subclasses Building?the?Simple?Factory Factory?Patterns?in?Math?Computation Thought?Questions Programs?on?the?CD-ROM Chapter?4??The?Factory?Method The?Swimmer?Class The?Event?Classes Straight?Seeding Our?Seeding?Program Other?Factories When?to?Use?a?Factory?Method Thought?Question Programs?on?the?CD-ROM Chapter?5??The?Abstract?Factory?Pattern A?GardenMaker?Factory How?the?User?Interface?Works Adding?More?Classes Consequences?of?the?Abstract?Factory?Pattern Thought?Question Programs?on?the?CD-ROM Chapter?6??The?Singleton?Pattern Creating?a?Singleton?Using?a?Static?Method Exceptions?and?Instances Throwing?an?Exception Creating?an?Instance?of?the?Class Providing?a?Global?Point?of?Access?to?a?Singleton?Pattern The?javax.comm?Package?as?a?Singleton Other?Consequences?of?the?Singleton?Pattern Thought?Question Programs?on?the?CD-ROM Chapter?7??The?Builder?Pattern An?Investment?Tracker Calling?the?Builders The?List?Box?Builder The?Check?Box?Builder Consequences?of?the?Builder?Pattern Thought?Questions Programs?on?the?CD-ROM Chapter?8??The?Prototype?Pattern Cloning?in?Java Using?the?Prototype Using?the?Prototype?Pattern Prototype?Managers Cloning?Using?Serialization Consequences?of?the?Prototype?Pattern Thought?Question Programs?on?the?CD-ROM Summary?of?Creational?Patterns Section?3??Structural?Patterns Chapter?9??The?Adapter?Pattern Moving?Data?between?Lists Using?the?JFC?JList?Class Two-Way?Adapters Pluggable?Adapters Adapters?in?Java Thought?Question Programs?on?the?CD-ROM Chapter?10??The?Bridge?Pattern The?Class?Diagram Extending?the?Bridge Java?Beans?as?Bridges Consequences?of?the?Bridge?Pattern Thought?Question Programs?on?the?CD-ROM Chapter?11??The?Composite?Pattern An?Implementation?of?a?Composite Computing?Salaries The?Employee?Classes The?Boss?Class Building?the?Employee?Tree Self-Promotion Doubly?Linked?List Consequences?of?the?Composite?Pattern A?Simple?Composite Composites?in?Java Other?Implementation?Issues Thought?Questions Programs?on?the?CD-ROM Chapter?12??The?Decorator?Pattern Decorating?a?CoolButton Using?a?Decorator The?Class?Diagram Decorating?Borders?in?Java Nonvisual?Decorators Decorators,?Adapters,?and?Composites Consequences?of?the?Decorator?Pattern Thought?Questions Programs?on?the?CD-ROM Chapter?13??The?Facade?Pattern Building?the?Facade?Classes Consequences?of?the?Facade?Pattern Notes?on?Installing?and?Running?the?dbFrame?Program Thought?Question Programs?on?the?CD-ROM Chapter?14??The?FI)weight?Pattern Discussion Example?Code Flyweight?Uses?in?Java Sharable?Objects Copy-on-Write?Objects Thought?Question Programs?on?the?CD-ROM Chapter?15??The?Proxy?Pattern Sample?Code Copy-on-Write Enterprise?Java?Beans Comparison?with?Related?Patterns Thought?Question Programs?on?the?CD-ROM Summary?of?Structural?Patterns Section?4??Behavioral?Patterns Chapter?16??Chain?of?Responsibility?Pattern Applicability Sample?Code The?List?Boxes Programming?a?Help?System A?Chain?or?a?Tree? Kinds?of?Requests Examples?in?Java Consequences?of?the?Chain?of?Responsibility Thought?Questions Programs?on?the?CD-ROM Chapter?17??The?Command?Pattern Motivation Command?Objects Building?Command?Objects The?Command?Pattern The?Command?Pattern?in?the?Java?Language Consequences?of?the?Command?Pattern Providing?Undo Thought?Questions Programs?on?the?CD-ROM Chapter?18??The?Interpreter?Pattern Motivation Applicability Simple?Report?Example Interpreting?the?Language Objects?Used?in?Parsing Reducing?the?Parsed?Stack Implementing?the?Interpreter?Pattern Consequences?of?the?Interpreter?Pattern Thought?Question programs?on?the?CD-ROM Chapter?19??The?Iterator?Pattern Motivation Enumerations?in?Java Sample?Code Filtered?Iterators Consequence?of?the?Iterator?Pattern Composites?and?Iterators Iterators?in?Java?1.2 Thought?Question Programs?on?the?CD-ROM Chapter?20??The?Mediator?Pattern An?Example?System Interactions?between?Controls Sample?Code Mediators?and?Command?Objects Consequences?of?the?Mediator?Pattern Single?Interface?Mediators Implementation?Issues Programs?on?the?CD-ROM Chapter?21??The?Memento?Pattern Motivation Implementation Sample?Code Consequences?of?the?Memento?Pattern Thought?Question Programs?on?the?CD-ROM Chapter?22??The?Observer?Pattern Watching?Colors?Change The?Message?to?the?Media The?JList?as?an?Observer The?MVC?Architecture?as?an?Observer The?Observer?Interface?and?Observable?Class Consequences?of?the?Observer?Pattern Thought?Questions Programs?on?the?CD-ROM Chapter?23??The?State?Pattern Sample?Code Switching?between?States How?the?Mediator?Interacts?with?the?StateManager State?Transitions Mediators?and?the?God?Class Consequences?of?the?State?Pattern Thought?Questions Programs?on?the?CD-ROM Chapter?24??The?Strategy?Pattern Motivation Sample?Code The?Context?Class The?Program?Commands The?Line?and?Bar?Graph?Strategies Drawing?Plots?in?Java Consequences?of?the?Strategy?Pattern Thought?Question Programs?on?the?CD-ROM Chapter?25??The?Template?Pattern Motivation Kinds?of?Methods?in?a?Template?Class Template?Method?Patterns?in?Java Sample?Code Templates?and?Callbacks Consequences?of?the?Template?Pattern Thought?Question Programs?on?the?CD-ROM Chapter?26??The?Visitor?Pattern Motivation When?to?Use?the?Visitor?Pattern Sample?Code Visiting?the?Classes Visiting?Several?Classes Bosses?are?Employees,?Too Catch-All?Operations?Using?Visitors Double?Dispatching Traversing?a?Series?of?Classes Consequence?of?the?Visitor?Pattern Thought?Question Programs?on?the?CD-ROM Section?5??Design?Patterns?and?the?Java?Foundation?Classes Chapter?27??The?JFC,?or?Swing Installing?and?Using?Swing Ideas?behind?Swing The?Swing?Class?Hierarchy Chapter?28??Writing?a?Simple?JFC?Program Setting?the?Look?and?Feel Setting?the?Window?Close?Box Making?a?JxFrame?Class A?Simple?Two-Button?Program More?on?JButton Programs?on?the?CD-ROM Chapter?29??Radio?Buttons?and?Toolbars Radio?Buttons The?JToolBar JToggleButton A?Sample?Button?Program Programs?on?the?CD-ROM Chapter?30??Menus?andActions Action?Objects Design?Patterns?in?the?Action?Object Programs?on?the?CD-ROM Chapter?31??The?JList?Class List?Selections?and?Events Changing?a?List?Display?Dynamically A?Sorted?JList?with?a?ListModel Sorting?More-Complicated?Objects Getting?Database?Keys Adding?Pictures?in?List?Boxes Programs?on?the?CD-ROM Chapter?32??The?JTable?Class A?Simple?JTable?Program Cell?Renderers Rendering?Other?Kinds?of?Classes Selecting?Cells?in?a?Table Patterns?Used?in?This?Image?Table Programs?on?the?CD-ROM Chapter?33??The?JTree?Class The?TreeModel?Interface Programs?on?the?CD-ROM Summary Section?6??Case?Studies Chapter?34??Sandy?and?the?Mediator Chapter?35??Herb''''''''s?Text?Processing?Tangle Chapter?36??Mary''''''''s?Dilemma Bibliography
| |
JAVA设计模式(含1CD)-相关图书 ·新起点电脑教程:计算机应用基础教程与上机指导 ·软交换技术Softswitch ·数据结构(徐孝凯 编) ·.NET开发人员调试策略 ·VISUAL FOXPRO 6.0程序设计教程 ·VisualFoxpro程序设计及其应用系统开发 ·C语言--程序设计导论(高等学校计算机志业) ·.NET框架1.1类库参考手册(含1张光盘) ·Fortrap95程序设计 ·全国计算机等级考试二级教程-Java语言程序设计(卡) ·Oracle实用用教程(郑阿奇 主编) ·COreldraw11中文版基础培训教程(第二版) ·(KH)WindowsServer2003用户管理指南(13 ·信息论编码与密码学9英文版) ·C语言程序设计 ·AUOTOCAD2004基础与实例教程CX-4171 ·Soffimage/XSI影视广告片头全攻略 ·软件技术基础(1545.0104) ·现场总线技术应用选编(1)(下)(邬宽明 主编) ·编程之道--VisualBasic.NET程序设计入门(1C
|
| |