You are previewing Effective Enterprise Java.
O'Reilly logo
Effective Enterprise Java

Book Description

"With this book, Ted Neward helps you make the leap from being a good Java enterprise developer to a great developer!"
—John Crupi, Sun Distinguished Engineer coauthor, Core J2EE Patterns

If you want to build better Java enterprise applications and work more efficiently, look no further. Inside, you will find an accessible guide to the nuances of Java 2 Platform, Enterprise Edition (J2EE) development. Learn how to:

  • Use in-process or local storage to avoid the network, see item 44

  • Set lower isolation levels for better transactional throughput, see item 35

  • Use Web services for open integration, see item 22

  • Consider your lookup carefully, see item 16

  • Pre-generate content to minimize processing, see item 55

  • Utilize role-based authorization, see item 63

  • Be robust in the face of failure, see item 7

  • Employ independent JREs for side-by-side versioning, see item 69

  • Ted Neward provides you with 75 easily digestible tips that will help you master J2EE development on a systemic and architectural level. His panoramic look at the good, the bad, and the ugly aspects of J2EE development will address your most pressing concerns. Learn how to design your enterprise systems so they adapt to future demands. Improve the efficiency of your code without compromising its correctness. Discover how to implement sophisticated functionality that is not directly supported by the language or platform. After reading Effective Enterprise Java, you will know how to design and implement better, more scalable enterprise-scope Java software systems.

    Table of Contents

    1. Copyright
    2. Effective Software Development Series Scott Meyers, Consulting Editor
      1. Titles in the Series
    3. Foreword
    4. Preface
      1. About the items
      2. Acknowledgments
      3. Reporting bugs, making suggestions, and getting book updates
    5. List of Abbreviations
    6. 1. Introduction
      1. The goals of J2EE
      2. Middleware and J2EE
      3. J2EE implementation
      4. The ten fallacies of enterprise computing
    7. 2. Architecture
      1. Item 1: Prefer components as the key element of development, deployment, and reuse
      2. Item 2: Prefer loose coupling across component boundaries
      3. Item 3: Differentiate layers from tiers
      4. Item 4: Keep data and processors close together
      5. Item 5: Remember that identity breeds contention
      6. Item 6: Use hook points to inject optimizations, customizations, or new functionality
      7. Item 7: Be robust in the face of failure
      8. Item 8: Define your performance and scalability goals
      9. Item 9: Restrict EJB to transactional processing
      10. Item 10: Never optimize without profiling first
      11. Item 11: Recognize the cost of vendor neutrality
      12. Item 12: Build in monitoring support
      13. Item 13: Build in administration support
      14. Item 14: Make deployment as simple as possible
    8. 3. Communication
      1. Item 15: Understand all your communications options
      2. Item 16: Consider your lookup carefully
      3. Item 17: Recognize the cost of network access
      4. Item 18: Prefer context-complete communication styles
      5. Item 19: Prefer data-driven communication over behavior-driven communication
      6. Item 20: Avoid waiting for remote service requests to respond
      7. Item 21: Consider partitioning components to avoid excessive load on any one machine
      8. Item 22: Consider using Web Services for open integration
      9. Item 23: Pass data in bulk
      10. Item 24: Consider rolling your own communication proxies
    9. 4. Processing
      1. Item 25: Keep it simple
      2. Item 26: Prefer rules engines for complex state evaluation and execution
      3. Item 27: Prefer transactional processing for implicitly nonatomic failure scenarios
      4. Item 28: Differentiate user transactions from system transactions
      5. Item 29: Minimize lock windows
      6. Item 30: Never cede control outside your component while holding locks
      7. Item 31: Understand EJB transactional affinity
      8. Item 32: Prefer local transactions to distributed ones
      9. Item 33: Consider using optimistic concurrency for better scalability
      10. Item 34: Consider using pessimistic concurrency for explicit concurrency control
      11. Item 35: Consider lower isolation levels for better transactional throughput
      12. Item 36: Use savepoints to keep partial work in the face of rollback
      13. Item 37: Replicate resources when possible to avoid lock regions
      14. Item 38: Favor the immutable, for it needs no locks
    10. 5. State Management
      1. Item 39: Use HttpSession sparingly
      2. Item 40: Use objects-first persistence to preserve your domain model
      3. Item 41: Use relational-first persistence to expose the power of the relational model
      4. Item 42: Use procedural-first persistence to create an encapsulation layer
      5. Item 43: Recognize the object-hierarchical impedance mismatch
      6. Item 44: Use in-process or local storage to avoid the network
      7. Item 45: Never assume you own the data or the database
      8. Item 46: Lazy-load infrequently used data
      9. Item 47: Eager-load frequently used data
      10. Item 48: Batch SQL work to avoid round-trips
      11. Item 49: Know your JDBC provider
      12. Item 50: Tune your SQL
    11. 6. Presentation
      1. Item 51: Consider rich-client UI technologies
        1. Dynamic HTML
        2. Macromedia Flash
        3. Applets
        4. The URLClassLoader class
        5. JNLP and Java Web Start
          1. Everything's a rich client?
      2. Item 52: Keep HTML minimal
      3. Item 53: Separate presentation from processing
      4. Item 54: Keep style separate from content
      5. Item 55: Pregenerate content to minimize processing
      6. Item 56: Validate early, validate everything
    12. 7. Security
      1. Item 57: Security is a process, not a product
      2. Item 58: Remember that security is not just prevention
      3. Item 59: Establish a threat model
      4. Item 60: Assume insecurity
      5. Item 61: Always validate user input
      6. Item 62: Turn on platform security
      7. Item 63: Use role-based authorization
      8. Item 64: Use SignedObject to provide integrity of Serialized objects
      9. Item 65: Use SealedObject to provide confidentiality of Serializable objects
      10. Item 66: Use GuardedObject to provide access control on objects
    13. 8. System
      1. Item 67: Aggressively release resources
      2. Item 68: Tune the JVM
      3. Item 69: Use independent JREs for side-by-side versioning
      4. Item 70: Recognize ClassLoader boundaries
        1. Isolation
        2. Versioning
      5. Item 71: Understand Java Object Serialization
        1. The serialVerUID field
        2. Customization (writeObject and readObject)
        3. Replacement (writeReplace and readResolve)
        4. Further details
      6. Item 72: Don't fight the garbage collector
      7. Item 73: Prefer container-managed resource management
      8. Item 74: Use reference objects to augment garbage collection behavior
        1. SoftReference objects
        2. WeakReference objects
        3. PhantomReference objects
      9. Item 75: Don't be afraid of JNI code on the server
    14. Bibliography
      1. Books
      2. Web Sites