title: What design pattern to use for User Authentication in Java
body: <p>There are certain common components that are used across projects:</p>
  
  <ol>
  <li>User Authentication and Authorization</li>
  <li>Exception Handling</li>
  <li>Logging</li>
  <li>E-mail</li>
  <li>DataBase Access</li>
  <li>Caching etc</li>
  </ol>
  
  <p>Is there a consistent design pattern that can be used for each of these common modules? By the way, the framework can vary like JAAS/JNDI for User Authentication and Authorization, log4j/java logging for logging, JavaMail for E-mai, JDBC/Hibernate for DataBase access.  </p>
  
  <p>For example there is DAO for database access. Is there any good design pattern that can be used for User Authentication and Authorization no matter what framework is used(JAAS/JNDI/SSO)?</p>