Search This Blog

Saturday, May 30, 2009

Coding Standards - Part-III

Hibernate
Does the DAO extend Spring's Hibernate DAO support class?

Does the DAO methods throw Spring's DataAccessException?
Like All DAO methods should throw Spring DataAccessException. Also, declare the throw in the DAO interface.

Does the Hibernate code generate n+1 queries for 1 to many queries?
i.e. If code fetchs parent class along with its childern, it should only issue one query. Verify by viewing the logs.

Does the HQL uses named parameters?

Does the collection mappings have lazy initialization set to true?
All collections should lazy initialized; Verify by looking at the logs.

Struts

Does the code use duplicate form submission for POST operations?
use saveToken and isTokenMethod in the action class

Does the name of the action class conform with the naming conventions?

Does the action class contain business logic?
Verify that most of the code is for page flow, validation, object conversion etc.

Is the action scope set to "request" in the mapping?

JSP

Are labels and texts externalize to properties files?

Does the code use JSTL?
Majority of the code should be written in JSLT.

Are the html tages lower case?
All html tags should be lower case.

JSP's that will be used for AJAX should not contain the HEAD and BODY tags.

No comments: