Bitter Java
Manning Publications (Verlag)
978-1-930110-43-4 (ISBN)
- Titel ist leider vergriffen;
keine Neuauflage - Artikel merken
Bitter Java is a book about common Java programming traps (called anti-patterns), their causes and resolutions. Anti-patterns for server side Java programming and architecture are the focus. It is intended for intermediate Java programmers, analysts and architects. The book covers anti-patterns for J2EE concepts such as servlets, JSPs, EJBs, enterprise connection models, and scalability.
There is a popular movement to capture positive design patterns, and an extensive library of design pattern books. Negative designs, sometimes called anti-patterns, are harder to find, but illustrate good programming practices much more graphically than design patterns. Anti-patterns have another benefit: they are fun.
Bitter Java will explore some basic anti-patterns and introduce intermediate to advanced techniques in clear and entertaining language. The book will feature code samples sprinkled throughout the book, and real-life metaphors that are unrelated to programming. The examples are refactored into solutions that work, and are available on a web site for immediate download and use.
Bruce Tate is a founder and independent consultant for J2Life, LLC, a consulting firm specializing in Internet education and services. He has worked in the information technology industry for fourteen years, spending the last seven years as an Internet architect.
foreword xv
preface xvii
acknowledgments xxi
about this book xxiii
about the cover illustration xxvii
Part 1 The basics 1
1 Bitter tales 3 1.1 A Java development free fall 4 Antipatterns in life 6 1.2 Using design patterns accentuates the positive 7 Design patterns online 8 UML provides a language for patterns 9 1.3 Antipatterns teach from the negative 9 Some well-known antipatterns 10 Antipatterns in practice 11 Antipattern resources 12 1.4 Antipattern ideas are not new 13 Learning from the industry 14 Detective work 15 Refactoring antipatterns 17 1.5 Why Bitter Java? 17 The Bitter Java approach 18 Bitter Java tools 18 The Bitter Java organization 19 The Bitter Java audience 21 1.6 Looking ahead 21 2 The bitter landscape 23 2.1 Fertile grounds for antipatterns 24 The benefits of layering 24 Layering can work against us 26 2.2 Internet technologies 28 Internet topologies affect our applications 28 Enterprise layers add security and overhead 29 Standards enable the Internet and add layers 31 TCP and IP provide low-level communications 32 HTTP provides application-level transport 33 HTML and XML 34 Mini-antipattern: Too Many Web Page Items 35 2.3 Object technologies and antipatterns 37 Encapsulation helps to isolate change 38 Inheritance enables packaging of common behavior 38 Polymorphism enables flexible reuse 39 Mini-antipatterns: Excessive Layering 39 Setting the stage for Java 42 2.4 Java technologies solve antipatterns 42 2.5 Major problems with the waterfall 44 Iterative methodologies 45 Mini-antipatterns: Incomplete Process Transitions 45 Programming horizons: Extreme programming 46 2.6 A quick survey of the bitter landscape 48 2.7 Antipatterns in this chapter 48 Part 2 Server-side Java antipatterns 51
3 Bitter servlets 53 3.1 Getting off on the wrong foot 54 An early antipattern: The Magic Pushbutton 54 Building with Model-View-Controller 56 Failing to separate model and view 56 Breaking out the model 58 3.2 Antipattern: The Magic Servlet 59 Can we use servlets as the model? 60 Stumbling into the Magic Servlet trap 62 Causes of the Magic Servlet 66 3.3 Solution: Refactor using commands 67 Break out the model 67 Wrapping the model with command objects 68 Separating the model logic 69 Separating the return trip 74 Using a JSP for the return trip 77 3.4 Summary 79 3.5 Antipattern in this chapter 79 4 Bitter JSPs 81 4.1 Getting only halfway home 82 Recognizing the danger signs 82 4.2 Antipattern: Monolithic JSPs 84 This program lacks model-view separation 84 Solution: Refactor to Model-View-Controller 86 4.3 Antipattern: Compound JSPs 88 Should we combine multiple JSPs? 88 An example combining two interfaces 89 Solution: Split the JSP 94 Making decisions in the controller servlet 94 4.4 Mini-antipatterns: Coarse and Fine Commands 98 Too many commands in a group 99 Solution: Refactor to appropriate granularity 99 Tips for granularity 101 4.5 Mini-antipattern: Fat Commands 102 4.6 Reviewing the JSP antipatterns 102 4.7 Antipatterns in this chapter 103 5 Bitter cache management 107 5.1 We need caches! 108 5.2 Antipattern: The Cacheless Cow 109 Bitter BBS with no cache 110 Building the model, view, and controller for ShowBoard 112 Building the model, view, and controller for ShowThread 115 Building the model, view and controller for AddPost 119 Performance problems 125 5.3 Solution: Cache 125 Solution 1: Use a hardware cache 126 Solution 2: Cache commands 126 Adding a cache to our BBS 128 Possible enhancements to cached commands 133 5.4 Cache-related mini-antipatterns 135 Concurrent access to static cache 135 The ever-growing cache 136 5.5 Antipattern: Synchronized Read/Write Bottlenecks 136 Collisions between readers can hurt performance 137 Read/write locks allow correct shared access 138 5.6 Cooking the Cacheless Cow 140 5.7 Antipatterns in this chapter 140 6 Bitter memories 143 6.1 Understanding memory leaks and antipatterns 144 Managing m
Erscheint lt. Verlag | 5.4.2002 |
---|---|
Verlagsort | New York |
Sprache | englisch |
Maße | 190 x 235 mm |
Gewicht | 645 g |
Themenwelt | Informatik ► Programmiersprachen / -werkzeuge ► Java |
Mathematik / Informatik ► Informatik ► Web / Internet | |
ISBN-10 | 1-930110-43-X / 193011043X |
ISBN-13 | 978-1-930110-43-4 / 9781930110434 |
Zustand | Neuware |
Haben Sie eine Frage zum Produkt? |
aus dem Bereich