Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rod Johnson's J2EE book

Sean Sullivan
Ranch Hand
Posts: 427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I highly recommend Rod Johnson's J2EE book.
Johnson provides many excellent strategies, techniques,
and examples.
Details below.
title: "expert one-on-one J2EE Design and Development"
author: Rod Johnson
Choosing an application server
Design techniques:
- Achieve loose coupling with interfaces ("Program to interfaces, not classes")
- use the Template Method design pattern ("inversion of control")
- use the Strategy design pattern
- use callbacks to achieve extensibility
- decouple components with the Observer pattern
- consider consolidating method parameters
Exception handling
- don't overuse checked exceptions
- overuse of checked exceptions can lead to:
too much code
unreadable code
endless wrapping of exceptions
fragile method signatures
checked exceptions don't always work well for interfaces
- "Use a checked exception if calling code can do something sensible
with the exception. Use an unchecked exception if the exception is
fatal, or if callers won't gain by catching it."
- use exception nesting (exception chaining)
- make exceptions informative
- separate user error messages from error codes
- "Include as much context information as possible with exceptions. If
an exception probably results from a programming error, try to
include information on how to rectify the problem."
When to use Reflection
Alternatives to the Singleton design pattern
Java coding standards
avoid code duplication
avoid literal constants
variables and methods should have the least possible visibility
(private, package, protected, public)
avoid public instance variables
fewer methods are better
where appropriate: final classes, final methods, final variables
implement toString() for diagnostics
handle null's correctly
document method behavior on null arguments
write test cases that invoke methods with null arguments
don't assume that an object can never be null ("This assumption causes many problems")
prefer array's to collections in public method signatures (Arrays provide
better type safety)
document code with javadoc comments

- use a standard logging library (Log4j, Commons Logging, or java.util.logging)
- "Never use System.out for logging" :-)
- pre-built frameworks versus building your own framework
Unit testing
- what, why, how
- tools: JUnit, Cactus, JUnitEE
- When to use EJB, when to avoid it
- Benefits and drawbacks of EJB
- How to use EJB
Transaction management in J2EE applications
"Don't use local transactions (such as JDBC transactions) in J2EE
applications [...] Instead, rely upon the EJB container or JTA [...]"
Asynchronous messaging
- Java Message Service - when to use it
- Java Message Service - potential drawbacks
- Message driven beans
- J2EE authentication and authorization
- deciding when to use XML
- XSLT pro's and cons
- XML parsing
- XML data binding
Data access
- JDBC vs JDO vs Entity Beans vs other O/R mapping solutions vs stored procedures
- the Data Access Object (DAO) pattern
- stored procedures, triggers, views, denormalization
- pessimistic locking, optimistic locking
- transaction isolation levels
- strategies for generating primary keys
Using JDBC
- techniques for effective JDBC exception handling
- disconnected data access (JDBC RowSets)
- Johnson recommends using a JDBC abstraction layer
Application configuration
- techniques for externalizing application configuration from application code
Web applications
- Model-View-Controller pattern
- strategies for a "clean" web tier
- session management in a web application
- data validation in a web application
- web caching, HTTP Cache-Control headers
- guidelines for JSP use
- JSP Custom Tags
Web application frameworks
- Struts
- Maverick
- WebWork
- template engines: Velocity, WebMacro, FreeMarker, XMLC
Generating PDF files using iText (page 591, page 705)
Build tools
- Ant
- understanding class loading
- class loading in J2EE
- thread context classloaders
Packaging and deployment
- JAR's, WAR's, EAR's
- deployment descriptors
Rod Johnson's Spring Framework
[ August 13, 2003: Message edited by: Sean Sullivan ]
Sean Sullivan
Ranch Hand
Posts: 427
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I, too, have heard it is a good book.
Correction! I have heard it is an amazing book.

[ August 15, 2003: Message edited by: HS Thomas ]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic