J2EE Programming Tips

Gerald Nguyen
Gerald Nguyen
2 min read ยท
Previous | Next
On this page

J2EE Programming

  1. Learn to program Java well. SCJP is nice to have.

  2. Do program with performance-awareness.

  3. Always try to optimize your program; performance is a big concern in any J2EE application.

  4. Dont just follow what other people call best practices, they may not fit your need while being costly to implement.

  5. J2EE application’s performance is often constraint by its interraction with database(s). Optimise your database access, data transaction management codes.

  6. A good framework can speed up development time considerably.

  7. Try not to use heavy solutions when a simpler one exists. Most of the time, they are just overkill and bring more perforance overhead rather than ease your development. (EJB, for example, does not only heavy but also complicated to build, configure and deploy).

And finally, make your code complex, and plant bugs so that your boss will always need you even in difficult economics time. (J/K)

JDBC Programming

  1. Use stored procedure for complex operations.

Stored Procedure offers an excellent way of retrieving and manipulating data that otherwise can only be accomplished using complex java code and multiple statements. Although using stored procedure for business logic is arguably inappropriate, more acceptable uses are to perform complex search and integrity-constraint update, insert operations. Performance-wise speaking, using stored procedure can reduce the number of time statement’s execute method get executed, hence reduce the cost of network communication and increase performance.

However, as I noticed, there are certain operations that is simply too complex to program in stored procedure. These operations often involve complex business logic and/or programming structures which are not available to stored procedure.