ENGLISH

Java Design Patterns: A Hands-On Experience with Real-World Examples

Book information

Publisher
Apress
Year
2019
ISBN
1484240774, 9781484240779
Language
english
Format
PDF
Filesize
8 MB (7960993 bytes)
Edition
2
Pages
502\512
Time added
2018-12-09 06:45:24

Description

Get hands-on experience implementing 26 of the most common design patterns using Java and Eclipse. In addition to Gang of Four (GoF) design patterns, you will also learn about alternative design patterns, and understand the criticisms of design patterns with an overview of anti-patterns. For each pattern you will see at least one real-world scenario, a computer-world example, and a complete implementation including output. This book has three parts. The first part covers 23 Gang of Four (GoF) design patterns. The second part includes three alternative design patterns. The third part presents criticisms of design patterns with an overview of anti-patterns. You will work through easy-to-follow examples to understand the concepts in depth and you will have a collection of programs to port over to your own projects. A Q&A session is included in each chapter and covers the pros and cons of each pattern. The last chapter presents FAQs about the design patterns. The step-by-step approach of the book helps you apply your skills to learn other patterns on your own, and to be familiar with the latest version of Java and Eclipse. What You'll Learn Work with each of the design patterns Implement design patterns in real-world applications Choose from alternative design patterns by comparing their pros and cons Use the Eclipse IDE to write code and generate output Read the in-depth Q&A session in each chapter with pros and cons for each design pattern Who This Book Is For Software developers, architects, and programmers Table of Contents......Page 5 About the Author......Page 19 About the Technical Reviewers......Page 20 Acknowledgments......Page 22 Foreword......Page 23 Introduction......Page 24 Part I: Gang of Four Patterns......Page 31 Real-World Example......Page 32 Class Diagram......Page 33 Discussion......Page 34 Implementation......Page 35 Q&A Session......Page 36 Output......Page 40 Discussion......Page 41 Bill Pugh?s Solution......Page 43 Double-Checked Locking......Page 44 Real-World Example......Page 47 Class Diagram......Page 48 Package Explorer View......Page 50 Implementation......Page 51 Output......Page 53 Q&A Session......Page 54 Demonstration......Page 57 Output......Page 59 Concept......Page 60 Computer-World Example......Page 61 Illustration......Page 62 Package Explorer View......Page 63 Implementation......Page 65 Q&A Session......Page 69 Modified Package Explorer View......Page 73 Modified Implementation......Page 75 Modified Output......Page 79 Analysis......Page 80 Concept......Page 82 Computer-World Example......Page 83 Class Diagram......Page 84 Implementation......Page 85 Modified Implementation......Page 88 Q&A Session......Page 90 Concept......Page 94 Illustration......Page 95 Class Diagram......Page 97 Package Explorer View......Page 98 Implementation......Page 99 Q&A Session......Page 103 Simple Factory Pattern Code Snippet......Page 104 Abstract Factory Pattern Code Snippet......Page 105 Conclusion......Page 106 Modified Implementation......Page 107 Modified Output......Page 112 Real-World Example......Page 113 Class Diagram......Page 114 Package Explorer View......Page 115 Implementation......Page 116 Q&A Session......Page 118 Alternate Implementation......Page 119 Output Without Lazy Instantiation......Page 121 Analysis......Page 122 Modified Package Explorer View......Page 124 Modified Implementation......Page 125 Modified Output......Page 127 Real-World Example......Page 129 Computer-World Example......Page 131 Class Diagram......Page 132 Implementation......Page 133 Output......Page 136 Q&A Session......Page 137 Real-World Example......Page 143 Computer-World Example......Page 144 Illustration......Page 145 Package Explorer View......Page 146 Implementation......Page 147 Modified Class Diagram......Page 149 Key Characteristics of?the?Modified Implementation......Page 150 Modified Package Explorer View......Page 152 Modified Implementation......Page 153 Object Adapters......Page 156 Class Adapters......Page 157 Q&A Session......Page 158 Real-World Example......Page 161 Illustration......Page 162 Class Diagram......Page 163 Package Explorer View......Page 164 Implementation......Page 165 Output......Page 169 Q&A Session......Page 170 Concept......Page 173 Computer-World Example......Page 174 Illustration......Page 175 Package Explorer View......Page 176 Implementation......Page 177 Output......Page 183 Q&A Session......Page 185 Concept......Page 190 Illustration......Page 191 Class Diagram......Page 192 Package Explorer View......Page 193 Implementation......Page 194 Output......Page 199 Q&A Session......Page 201 Real-World Example......Page 204 Illustration......Page 205 Class Diagram......Page 208 Package Explorer View......Page 209 Implementation......Page 210 Output......Page 214 Q&A Session......Page 215 Concept......Page 217 Illustration......Page 218 Class Diagram......Page 219 Implementation......Page 220 Modified Illustration......Page 222 Key Characteristic of?the?Modified Example......Page 223 Step 2......Page 224 Step 3......Page 225 Step 5......Page 226 Modified Package Explorer View......Page 228 Modified Implementation......Page 230 Modified Output......Page 236 Q&A Session......Page 237 Concept......Page 240 Computer-World Example......Page 243 Illustration......Page 244 Package Explorer View......Page 245 Implementation......Page 247 Q&A Session......Page 250 Real-World Example......Page 255 Illustration......Page 256 Package Explorer View......Page 257 Implementation......Page 259 Q&A Session......Page 262 Real-World Example......Page 272 Class Diagram......Page 273 Package Explorer View......Page 274 Implementation......Page 275 Q&A Session......Page 277 Modified Implementation......Page 278 Modified Output......Page 281 Real-World Example......Page 283 Illustration......Page 284 Class Diagram......Page 285 Package Explorer View......Page 286 Implementation......Page 287 Q&A Session......Page 290 Modified Class Diagram......Page 291 Modified Package Explorer View......Page 292 Modified Implementation......Page 294 Modified Output......Page 300 Concept......Page 304 Real-World Example......Page 305 Illustration......Page 306 Class Diagram......Page 307 Package Explorer View......Page 309 First Implementation......Page 310 Output......Page 312 Second Implementation......Page 313 Output......Page 315 Q&A Session......Page 316 Third Implementation......Page 318 Output......Page 321 Real-World Example......Page 322 Illustration......Page 323 Class Diagram......Page 324 Implementation......Page 325 Output......Page 328 Q&A Session......Page 329 Modified Caretaker Class......Page 330 Modified Output......Page 331 Analysis......Page 332 Key Characteristics of?the?Following Program......Page 340 Implementation......Page 341 Analysis......Page 344 Analysis......Page 345 Concept......Page 347 Illustration......Page 348 Class Diagram......Page 350 Package Explorer View......Page 352 Implementation......Page 353 Output......Page 357 Q&A Session......Page 358 Modified Package Explorer View......Page 361 Modified Implementation......Page 363 Modified Output......Page 368 Real-World Example......Page 371 Computer-World Example......Page 372 Illustration......Page 373 Class Diagram......Page 374 Package Explorer View......Page 375 Implementation......Page 377 Modified Illustration......Page 381 Modified Class Diagram......Page 383 Modified Package Explorer View......Page 384 Modified Implementation......Page 385 Modified Output......Page 390 Q&A Session......Page 391 Concept......Page 395 Computer-World Example......Page 396 Illustration......Page 397 Class Diagram......Page 398 Package Explorer View......Page 399 Implementation......Page 400 Output......Page 403 Q&A Session......Page 404 Concept......Page 406 Illustration......Page 408 Class Diagram......Page 410 Package Explorer View......Page 411 Implementation......Page 412 Output......Page 416 Modified Package Explorer View......Page 417 Modified Implementation......Page 418 Analysis......Page 423 Q&A Session......Page 424 Part II: Additional Design Patterns......Page 425 Real-World Example......Page 426 Computer-World example......Page 427 Class Diagram......Page 428 Package Explorer View......Page 429 Implementation......Page 430 Output......Page 432 Case3. An?unwanted user input:2......Page 433 Q&A Session......Page 434 Concept......Page 436 A Faulty Program......Page 437 Analysis with?an?Unwanted Input......Page 439 Analysis......Page 440 Illustration......Page 441 Class Diagram......Page 442 Package Explorer View......Page 443 Implementation......Page 444 Output......Page 447 Q&A Session......Page 448 Concept......Page 452 Key Points to?Remember......Page 453 Variation 2......Page 454 Real-World Example......Page 455 Computer-World Example......Page 456 Class Diagram......Page 457 Implementation......Page 459 Output......Page 467 Q&A Session......Page 468 Modified Output......Page 470 Part III: Final Discussions on Design Patterns......Page 473 Chapter 27: Criticisms of?Design Patterns......Page 474 Q&A Session......Page 476 What Is an?Antipattern?......Page 480 Brief History of?Antipatterns......Page 481 Examples of?Antipatterns......Page 482 Q&A Session......Page 484 Chapter 29: FAQs......Page 488 Appendix A: A Brief Overview of GoF Design Patterns......Page 494 Key Points......Page 495 B.?Structural Patterns......Page 496 C.?Behavioral Patterns......Page 497 Q&A Session......Page 499 Appendix B: Winning Notes and the Road Ahead......Page 502 Appendix C: Bibliography......Page 503 Index......Page 505

Similar books