A
Anonymous
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
http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/
Choosing an application server
Design techniques:
- Achieve loosing 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
Logging
- use a standard logging library (Log4j, Commons Logging, or
java.util.logging)
- "Never use System.out for logging"
Frameworks
- pre-built frameworks versus building your own framework
Unit testing
- what, why, how
- tools: JUnit, Cactus, JUnitEE
EJB
- 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
Security
- J2EE authentication and authorization
XML
- 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
Classloading
- 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
http://www.springframework.org/
Johnson provides many excellent strategies, techniques,
and examples.
Details below.
title: "expert one-on-one J2EE Design and Development"
author: Rod Johnson
http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/
Choosing an application server
Design techniques:
- Achieve loosing 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
Logging
- use a standard logging library (Log4j, Commons Logging, or
java.util.logging)
- "Never use System.out for logging"
Frameworks
- pre-built frameworks versus building your own framework
Unit testing
- what, why, how
- tools: JUnit, Cactus, JUnitEE
EJB
- 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
Security
- J2EE authentication and authorization
XML
- 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
Classloading
- 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
http://www.springframework.org/