Holub on patterns

Free Download

Authors:

Edition: Second Edition

ISBN: 9781590593882, 159059388X

Size: 5 MB (4872038 bytes)

Pages: 426/426

File format:

Language:

Publishing Year:

Category:

Allen Holub9781590593882, 159059388X

Most programmers learn by looking at computer programs. This book teaches you design patterns in exactly this way: by looking at computer programs and analyzing them in terms of the patterns that they use. Consequently, you learn how the patterns actually occur in the real world, and how to apply the patterns to solve real problems. This book also looks at the broader context of OO (Object-Oriented) design and how the patterns solve commonplace OO design problems. It covers many of the principles of OO design – principles not covered by most books on Java – and shows you how to apply these principles to make your code easier to maintain and debug.The existing books on design patterns take a “catalog” approach, where they show the individual design patterns in isolation. This approach is fundamentally flawed because you cant see how the design patterns actually function in the real world. The patterns in real programs interact in complex ways, working in concert to solve many problems simultaneously. By seeing the patterns actually applied in a realistic way, you can really understand how to use them in your own code.

Table of contents :
Patterns vs. Idioms……Page 1
So, What’s It All Good For?……Page 5
The Role of Patterns in Design……Page 6
The Tension Between Patterns and Simplicity……Page 7
Classifying Patterns……Page 8
On Design, Generally……Page 10
Programming FORTRAN in Java……Page 11
Programming with Your Eyes Open……Page 13
What Is an Object?……Page 14
An Object Is a Bundle of Capabilities……Page 15
How Do You Do It Wrong?……Page 17
So How Do You Do It “Right?”……Page 19
Getters and Setters Are Evil……Page 27
Render Thyself……Page 31
JavaBeans and Struts……Page 32
Refactoring……Page 33
Life Without Get/Set……Page 34
When Are Accessors and Mutators Okay?……Page 37
Summing Up the Getter/Setter Issues……Page 39
Why extends Is Evil……Page 42
Interfaces vs. Classes……Page 43
Losing Flexibility……Page 44
Coupling……Page 45
The Fragile-Base-Class Problem……Page 46
Multiple Inheritance……Page 53
Frameworks……Page 54
The Template-Method and Factory-Method Patterns……Page 55
Summing Up Fragile Base Classes……Page 60
When extends Is Appropriate……Page 62
Getting Rid of extends……Page 64
Factories and Singletons……Page 65
Singleton……Page 68
Threading Issues in Singleton……Page 69
Double-Checked Locking (Don’t Do It)……Page 71
Killing a Singleton……Page 72
Abstract Factory……Page 74
Pattern Stew……Page 77
Dynamic Creation in a Factory……Page 79
Command and Strategy……Page 82
Summing Up……Page 86
Overview……Page 88
The Clock Subsystem: Observer……Page 93
Implementing Observer: The Publisher Class……Page 99
The Clock Subsystem: The Visitor Pattern……Page 110
The Menuing Subsystem: Facade and Bridge……Page 123
The Universe Class……Page 145
The Cell Interface……Page 150
The Resident Class……Page 153
The Neighborhood Class……Page 156
Mediator……Page 166
Composite Revisited……Page 167
Prototype……Page 170
Flyweight……Page 178
Flyweight Pools……Page 182
Summing Up……Page 192
The Requirements……Page 193
The Data-Storage Layer……Page 196
The Table Interface……Page 197
The Bridge Pattern……Page 202
Creating a Table, Abstract Factory……Page 204
Creating and Saving a Table: Passive Iterators and Builder……Page 207
Populating the Table……Page 219
Examining a Table: The Iterator Pattern……Page 222
Passive Iterators……Page 228
Implementing Transactions (Undo) with the Command Pattern……Page 231
Modifying a Table: The Strategy Pattern……Page 236
Selection and Joins……Page 240
Miscellany……Page 247
Variants on the Table: The Decorator Pattern……Page 255
Adding SQL to the Mix……Page 264
Input Tokenization, Flyweight Revisited, and Chain of Responsibility……Page 266
The Scanner: Chain of Responsibility……Page 274
The ParseFailure Class……Page 282
Using the Database……Page 284
The Proxy Pattern……Page 288
The Token Set and Other Constants……Page 292
Supported SQL……Page 300
Watching the Interpreter in Action……Page 323
The State Pattern and JDBCConnection……Page 336
Statements……Page 342
The Adapter Pattern (Result Sets)……Page 343
Finishing Up the Code……Page 347
When Bridges Fail……Page 348
Whew!……Page 349
Creational Patterns……Page 350
What Problem Does It Solve?……Page 351
Implementation Notes and Example……Page 352
Usage……Page 353
What Problem Does It Solve?……Page 354
Implementation Notes and Example……Page 355
Usage……Page 356
Factory Method……Page 357
Implementation Notes and Example……Page 358
Usage……Page 359
Prototype……Page 360
Implementation Notes and Example……Page 361
Usage……Page 362
Singleton……Page 363
Implementation Notes and Examples……Page 364
Usage……Page 365
Adapter……Page 366
Pros (√) and Cons (×)……Page 367
Implementation Notes and Example……Page 368
Usage……Page 369
Pros (√) and Cons (×)……Page 370
Implementation Notes and Example……Page 371
Composite……Page 372
Pros (√) and Cons (×)……Page 373
Implementation Notes and Example……Page 374
Decorator……Page 375
What Problem Does It Solve?……Page 376
Implementation Notes and Example……Page 377
Usage……Page 378
What Problem Does It Solve?……Page 379
Often Confused With……Page 380
Implementation Notes and Example……Page 381
Flyweight……Page 382
Pros (√) and Cons (×)……Page 383
Implementation Notes and Example……Page 384
Proxy……Page 385
What Problem Does It Solve?……Page 386
Implementation Notes and Example……Page 387
Usage……Page 388
Chain of Responsibility……Page 389
See Also……Page 390
Implementation Notes and Example……Page 391
Command……Page 392
What Problem Does It Solve?……Page 393
Implementation Notes and Example……Page 394
Interpreter……Page 396
Pros (√) and Cons (×)……Page 397
Implementation Notes and Example……Page 398
What Problem Does It Solve?……Page 400
See Also……Page 401
Implementation Notes and Example……Page 402
Mediator……Page 403
Often Confused With……Page 404
Implementation Notes and Example……Page 405
Usage……Page 406
What Problem Does It Solve?……Page 407
Implementation Notes and Example……Page 408
Usage……Page 409
What Problem Does It Solve?……Page 410
Often Confused With……Page 411
Implementation Notes and Example……Page 412
Usage……Page 413
What Problem Does It Solve?……Page 414
Implementation Notes and Example……Page 415
What Problem Does It Solve?……Page 417
Implementation Notes and Example……Page 418
Usage……Page 419
Pros (√) and Cons (×)……Page 420
Implementation Notes and Example……Page 421
Visitor……Page 422
Pros (√) and Cons (×)……Page 423
Implementation Notes and Example……Page 424

Reviews

There are no reviews yet.

Be the first to review “Holub on patterns”
Shopping Cart
Scroll to Top