Bitter Java
Home > Computing and Information Technology > Computer programming / software engineering > Bitter Java
Bitter Java

Bitter Java

|
     0     
5
4
3
2
1




International Edition


About the Book

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.

Table of Contents:
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


Best Sellers


Product Details
  • ISBN-13: 9781930110434
  • Publisher: Manning Publications
  • Publisher Imprint: Manning Publications
  • Height: 235 mm
  • No of Pages: 368
  • Spine Width: 20 mm
  • Width: 190 mm
  • ISBN-10: 193011043X
  • Publisher Date: 05 Apr 2002
  • Binding: Paperback
  • Language: English
  • Returnable: Y
  • Weight: 645 gr


Similar Products

Add Photo
Add Photo

Customer Reviews

REVIEWS      0     
Click Here To Be The First to Review this Product
Bitter Java
Manning Publications -
Bitter Java
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Bitter Java

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals

    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!