Design Patterns C++ code

  • F0_694208
  • 4.5MB
  • zip
  • 0
  • VIP专享
  • 0
  • 2022-05-06 06:53
设计模式, 英文版, C++源代码 Design Patterns: Elements of Reusable Object-Oriented Software
<HTML> <BODY BGCOLOR = #FFFFFF TEXT = #000000 > <!-- Index --> <P>Names of design patterns appear in small capitals: e.g., Adapter. Page numbers in bold indicate the definition of a term. Numbers in italics indicate a diagram for the term. Letters after a diagram's page number indicate the kind of diagram: a "c" denotes a class diagram, an "i" denotes an interaction diagram, and an "o" denotes an object diagram. For example, 88co means that a class and object diagram appears on page 88.</P> <H2>A</H2> <DL> <DT>abstract class 15, 16c, 359, 364, 365c</DT> <DT>abstract coupling, <I>see</I> coupling, abstract</DT> <DD>in Observer 296</DD> <DT>Abstract Factory 87</DT> <DD>extensibility of 91</DD> <DD>in catalog summary 8</DD> <DD>Lexi's use of 51</DD> <DD>used to configure a subsystem 193</DD> <DT>Abstract Factory</DT> <DD>participant of Abstract Factory 88c, 89</DD> <DT>abstract operation, <I>see</I> operation, abstract</DT> <DD>use to implement Adapter 144</DD> <DT>abstract syntax tree 244, 251, 331</DT> <DD>class structure for 244c, 331c</DD> <DD>constructing in Smalltalk 250</DD> <DD>object structure for 244o</DD> <DT>AbstractExpression</DT> <DD>participant of Interpreter 245c, 245</DD> <DT>Abstraction</DT> <DD>participant of Bridge 153c, 154</DD> <DT>AbstractProduct</DT> <DD>participant of Abstract Factory 88c, 89</DD> <DT>accumulating state 336</DT> <DT>acquaintance 22, 359</DT> <DD>C++, defined in 23</DD> <DD>compared with aggregation 23</DD> <DD>Smalltalk, defined in 23</DD> <DT>Action, <I>see</I> Command</DT> <DT>active iterator, <I>see</I> iterator, active</DT> <DT>Ada 4, 21</DT> <DT>Adaptee</DT> <DD>participant of Adapter 141, 141c</DD> <DT>Adapter 139</DT> <DD>compared with Bridge 161, 219</DD> <DD>compared with Decorator 184</DD> <DD>compared with Proxy 216</DD> <DD>in catalog summary 8</DD> <DT>Adapter</DT> <DD>participant of Adapter 141, 141c</DD> <DT>adapter 140</DT> <DD>class adapter 141, 141c</DD> <DD>object adapter 141, 141c</DD> <DD>parameterized 145</DD> <DD>pluggable, <I>see</I> pluggable adapter</DD> <DD>two-way 143, 143c</DD> <DT>adorner 179</DT> <DT>Aggregate</DT> <DD>participant of Iterator 259, 259c</DD> <DT>aggregate object 257</DT> <DT>aggregation 22, 359</DT> <DD>C++, defined in 23</DD> <DD>compared with acquaintance 23</DD> <DD>notation for 23</DD> <DD>Smalltalk, defined in 23</DD> <DT>Alexander, Christopher xiii, 2, 356, 358</DT> <DT>algorithm</DT> <DD>avoiding dependence on 24</DD> <DD>defining steps of 326</DD> <DD>family of 317</DD> <DD>skeleton 327</DD> <DT>AlternationExpression 244co, 343</DT> <DD>implemented in Smalltalk 249</DD> <DT>aluminum alloy 76</DT> <DT>Ambassador, <I>see also</I> Proxy</DT> <DD>C++ idiom 208</DD> <DT>AnalogClock 303</DT> <DT>analysis object model</DT> <DD>transforming to design object model 353</DD> <DT>ancestor class 361, <I>see</I> also class, parent</DT> <DT>Anderson, Bruce xi, 357</DT> <DT>AndExp 253</DT> <DT>Andrew Toolkit</DT> <DD>use of Observer 303</DD> <DT>Application 107, 107c, 223o, 224ci, 231, 325, 325c</DT> <DT>application programs 25</DT> <DT>ApplicationWindow 53, 54c, 55c, 157, 233c, 234c</DT> <DT>ArrayCompositor 42c, 315, 315c, 322</DT> <DT>ASCII7Stream 183, 183c</DT> <DT>aspect of an object 298</DT> <DT>AssignmentNode 333c</DT> <DT>associations, <I>see also</I> acquaintance, aggregation</DT> <DD>in OMT 364</DD> </DL> <H2>B</H2> <DL> <DT>BTree 202</DT> <DT>base class, <I>see</I> class, parent</DT> <DT>Beck, Kent xi, 357</DT> <DT>Bedrock</DT> <DD>use of Decorator 179, 180</DD> <DT>behavioral pattern 10, 221</DT> <DD>comparison between class and object scope 221</DD> <DD>discussion 345</DD> <DT>black-box reuse, <I>see</I> reuse, black-box</DT> <DT>block, Smalltalk 270</DT> <DT>BNF form 247</DT> <DD>examples of 243, 248, 251</DD> <DT>BombedMazeFactory 93</DT> <DT>BombedMazeGame 115</DT> <DT>BombedWall 93, 94, 124</DT> <DT>Booch Components</DT> <DD>use of Iterator 270</DD> <DD>use of Strategy 323</DD> <DT>Booch, Grady xiii, 260</DT> <DT>Booch method 363</DT> <DT>Boolean</DT> <DD>expression 251</DD> <DD>variable 254</DD> <DT>BooleanExp 252</DT> <DT>Border 44, 45c, 46o</DT> <DT>BorderDecorator 176o, 176c, 180</DT> <DT>Bridge 151</DT> <DD>compared with Adapter 219</DD> <DD>configured by Abstract Factory 155</DD> <DD>in catalog summary 8</DD> <DD>Lexi's use of 58</DD> <DD>use of delegation in 21</DD> <DT>bridge 152</DT> <DT>broadcast communication 296</DT> <DT>Builder 97</DT> <DD>compared with Abstract Factory 105, 135</DD> <DD>compared with Prototype 135</DD> <DD>in catalog summary 8</DD> <DD>use in compiler example 189</DD> <DT>Builder</DT> <DD>participant of Builder 98, 98c</DD> <DT>Bureaucrat 232, <I>see also</I> Chain of Responsibility</DT> <DT>Button 50c, 223o, 224ci, 229, 279</DT> </DL> <H2>C</H2> <DL> <DT>C 4</DT> <DT>Calder, Paul 33, 38</DT> <DT>callback function 235</DT> <DT>Caretaker</DT> <DD>participant of Memento 285, 285c, 286i</DD> <DT>Cargill, Tom 308</DT> <DT>Chain of Responsibility 223</DT> <DD>combined with Composite 166, 232</DD> <DD>compared with Mediator 348</DD> <DD>compared with Observer 348</DD> <DD>defined by parent references 166, 232</DD> <DD>in catalog summary 8</DD> <DD>use of delegation in 21</DD> <DT>ChangeManager 282, 299, 300c</DT> <DT>Character 38, 38c</DT> <DT>character</DT> <DD>represented as object 38, 195196</DD> <DT>Cheshire Cat 155</DT> <DT>Choices operating system</DT> <DD>use of Facade 192</DD> <DD>use of Proxy 209</DD> <DT>class 14, 359</DT> <DD>abstract, <I>see</I> abstract class</DD> <DD>adapter, <I>see</I> adapter, class</DD> <DD>compared with type 16</DD> <DD>concrete, <I>see</I> concrete class</DD> <DD>derived 360</DD> <DD>friend, <I>see</I> friend class</DD> <DD>inability to alter 24</DD> <DD>inheritance, <I>see</I> inheritance</DD> <DD>instance 15</DD> <DD>library, <I>see</I> toolkit</DD> <DD>mixin, <I>see</I> mixin class</DD> <DD>notation for 15, 363</DD> <DD>parent 15, 361</DD> <DD>subclass 15</DD> <DD>template, <I>see</I> template</DD> <DT>class diagram 363, 365c, 359</DT> <DT>class hierarchy</DT> <DD>adding operations to 356</DD> <DD>connecting parallel 109, 258</DD> <DD>explosion 25, 43, 151, 177</DD> <DD>minimizing size of 113, 120, 177, 277, 317, 348</DD> <DD>visiting multiple 336</DD> <DT>class operation 359</DT> <DD>alternatives provided by Singleton 128</DD> <DT>Client</DT> <DD>participant of Abstract Factory 88c, 89</DD> <DD>participant of Adapter 141, 141c</DD> <DD>participant of Builder 98, 98c, 99i</DD> <DD>participant of Chain of Responsibility 225ci, 226, 348i</DD> <DD>participant of Command 236, 236c, 237i</DD> <DD>participant of Composite 164c, 165</DD> <DD>participant of Flyweight 198c, 199</DD> <DD>participant of Interpreter 245c, 246</DD> <DD>participant of Prototype 119, 119c</DD> <DT>client 11</DT> <DD>isolating concrete classes from 89</DD> <DT>ClockTimer 302</DT> <DT>clone operation 117</DT> <DD>used in Prototype 117</DD> <DD>implementing 121</DD> <DT>cloned object 117</DT> <DD>initializing 121</DD> <DT>CLOS 4, 260, 338</DT> <DT>closure 260, 267</DT> <DT>Coad, Peter 357</DT> <DT>code structure</DT> <DD>run-time versus compile-time 23</DD> <DT>CodeGenerationVisitor 332c</DT> <DT>Colleague</DT> <DD>communicating with Mediator 278, 282</DD> <DD>participant of Mediator 276co, 277, 348i</DD> <DT>Command 233</DT> <DD>combined with Memento 239, 287</DD> <DD>combined with Prototype 238</DD> <DD>in catalog summary 8</DD> <DD>use in Lexi 64</DD> <DT>Command 60, 61c, 233, 233c, 239</DT> <DD>configured in MenuItem 61</DD> <DD>history of 62</DD> <DD>participant of Command 236, 236c, 237i, 347i</DD> <DT>command</DT> <DD>C++ idiom, <I>see</I> functor</DD> <DD>copying before execution 238</DD> <DD>history, <I>see</I> history list</DD> <DD>implemented through C++ templates 239, 240</DD> <DD>intelligence