Book description
Java developers typically go through four "stages" in mastering Java. In the first stage, they learn the language itself. In the second stage, they study the APIs. In the third stage, they become proficient in the environment. It is in the fourth stage --"the expert stage"-- where things really get interesting, and Java Enterprise Best Practices is the tangible compendium of experience that developers need to breeze through this fourth and final stage of Enterprise Java mastery.Crammed with tips and tricks, Java Enterprise Best Practices distills years of solid experience from eleven experts in the J2EE environment into a practical, to-the-point guide to J2EE.Java Enterprise Best Practices gives developers the unvarnished, expert-tested advice that the man pages don't provide--what areas of the APIs should be used frequently (and which are better avoided); elegant solutions to problems you face that other developers have already discovered; what things you should always do, what things you should consider doing, and what things you should never do--even if the documentation says it's ok.Until Java Enterprise Best Practices, Java developers in the fourth stage of mastery relied on the advice of a loose-knit community of fellow developers, time-consuming online searches for examples or suggestions for the immediate problem they faced, and tedious trial-and-error. But Java has grown to include a huge number of APIs, classes, and methods. Now it is simply too large for even the most intrepid developer to know it all. The need for a written compendium of J2EE Best Practices has never been greater.Java Enterprise Best Practices focuses on the Java 2 Enterprise Edition (J2EE) APIs. The J2EE APIs include such alphabet soup acronyms as EJB, JDBC, RMI, XML, and JMX.
Publisher resources
Table of contents
- A Note Regarding Supplemental Files
- Preface
- 1. Introduction to Java Enterprise Best Practices
-
2. EJB Best Practices
- Design
-
Implementation
- Use Local Interfaces for Entity Beans
- Use Business Interfaces
- Handle Exceptions in EJB Code Correctly
- Know When to Use Compound Primary Keys
- Know How to Handle Large Queries
- Use Dirty Flags in ejbStore
- Use Lazy Loading
- Cache JNDI Lookup Objects
- Use Business Delegates for Clients
- Write Dual CMP/BMP Entity Beans
- Create Domain Object Factories
- Deployment and Packaging
- 3. Servlet Best Practices
-
4. JDBC Best Practices
- Configuration
- Design
-
Code
- Use PreparedStatement
- Leverage PreparedStatement Pooling
- Question Using Nonstandard SQL
- Delay Access to Metadata
- Reference Columns by Number
- Navigate a ResultSet Forward Only
- Close Statements and Result Sets
- Thread JDBC Code in Swing Applications
- Minimize Database Calls and Perform Lazy-Loading
- Cache Lookup Tables
- Use wasNull( ) Checks
- General Database
- 5. XML Best Practices
-
6. RMI Best Practices
-
Marshalling and Unmarshalling Objects
- Use Value Objects to Separate Marshalling Code from Your Application Logic
- Use Flat Hierarchies When Designing Value Objects
- Be Aware of How Externalization and Serialization Differ with Respect to Superclasses
- Don’t Marshal Inner Classes
- Always Explicitly Initialize Transient Fields Inside Marshalling Methods
- Always Set the serialVersionUID
- Set Version Numbers Independently of serialVersionUID
- Never Use Default Serialization
- Always Unit-Test Marshalling Code
- Profile Before Customizing
- Consider Using Byte Arrays to Store Marshalling Results
-
Making Applications More Robust
- Include Logic for Retrying Remote Calls
- Associate Unique Identifiers with Requests
- Distinguish Between Network Lag Time and Server Load
- Wrap RMI Calls in Command Objects
- Consider Using a Naming Service
- Don’t Throw RemoteException in Your Server Code
- Distinguish Between Different Types of Remote Exceptions
- Use the Unreferenced Interface to Clean Up Allocated Server State
- Always Configure the Distributed Garbage Collector
- Improving Application Performance
- Further Reading
-
Marshalling and Unmarshalling Objects
- 7. Java Management Extensions
- 8. Enterprise Internationalization
-
9. JSP Best Practices
- Appropriate Usage of JSP in an Enterprise Application
- Page Design
- Caching
- Error Handling
-
Custom Component Development
- Choosing Between Beans and Custom Actions
- Consider Using Immutable Objects
- Consider Using a Reset Property When Capturing Input
- Always Include the <uri> Element in the TLD
- Design Tag Handler Classes for Instance Pooling
- Consider Adopting the JSTL Conventions
- Leverage the JSTL Classes and Interfaces
- Consider Developing a Tag Library Validator
- Deployment
- 10. JavaMail Best Practices
- 11. Enterprise Performance Tuning Best Practices
- 12. List of Contributors
- Index
- Colophon
- Copyright
Product information
- Title: Java Enterprise Best Practices
- Author(s):
- Release date: December 2002
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596003845
You might also like
book
Java APIs, Extensions and Libraries: With JavaFX, JDBC, jmod, jlink, Networking, and the Process API
This book completes the Apress Java learning journey and is a comprehensive approach to learning Java …
book
Developing Enterprise Java Applications with J2EE™ and UML
The Java 2 Platform Enterprise Edition (J2EE TM) offers great promise for dramatically improving the way …
book
Apache Jakarta Commons: Reusable Java™ Components
Easy-to-follow coverage of twelve indispensable Jakarta Commons packages Code examples that show innovative uses of Commons …
book
Rapid Java Persistence and Microservices: Persistence Made Easy Using Java EE8, JPA and Spring
Gain all the essentials you need to create scalable microservices, which will help you solve real …