Category |
Best Practice Number and Description |
Importance |
Servlets |
1. Do not store large object graphs in HttpSession |
2 |
Servlets |
2. Release HttpSessions when finished |
3 |
JSP Files |
3. Do not create HttpSessions in JSPs by default |
4 |
Servlets |
4. Minimize synchronization in Servlets |
2 |
Servlets |
5. Do not use SingleThreadModel |
5 |
All web and enterprise application components |
6. Use JDBC connection pooling |
3 |
All web and enterprise application components |
7. Reuse datasources for JDBC connections |
1 |
All web and enterprise application components |
8. Release JDBC resources when done |
3 |
Servlets |
9. Use the HttpServlet Init method to perform expensive
operations that need only be done once |
4 |
All web and enterprise application components |
10. Minimize use of System.out.println
|
2 |
All web and enterprise application components |
11. Avoid String concatenation “+=”
|
1 |
Enterprise beans |
12. Access entity beans from session beans
|
3 |
Enterprise beans |
13. Reuse EJB homes |
1 |
Enterprise beans |
14. Use “Read-Only” methods where appropriate
|
3 |
Enterprise beans |
15. Reduce the transaction isolation level where appropriate
|
5 |
Enterprise beans |
16. EJBs and Servlets - same JVM - “No local copies”
|
2 |
Enterprise beans |
17. Remove stateful session beans when finished
|
2 |
Servlets |
18. Don’t use Beans.instantiate() to create new bean
instances |
3 |