2010-12-07

Best Practice for Application Processing

Transaction

  • Start the transaction at later step as possible. So, the request handling service of the framework would be better not to start transaction.
  • End (commit or rollback) the transaction at later step as possible. The response handling service of the framework after the successful return of the application module could find a serious problem which should rollback the transaction.

Exception

  • Bypass the exception which would not be resolved to the later step of the processing as possible.

Logging

  • Log error at the later step of the processing as possible.
  • Define and implement logging service layer and encapsulate fundamental logging framework such as SLF4J, Log4j or Apache Commons Logging below it.
    The logging service layer can provide features such as contextual logging.

No comments:

Post a Comment