Hi Guys,
I have a fully implemented DAO and all my beans inherit an Entity object. Now, I want to create a client notification system whereby, when a user creates/updates/delete an entity to/from a persistence storage, a notification is automatically sent to the client via email.
I have a DAO manager that uses a Factory Pattern to return to me a manager of the DAO based on the entity type.
e.g EntityManager manager = EntityManagerFactory.createEntityManager(Product.class);
each manager has a create(), remove(), update() method....
My first idea is to have all my entity managers inherit an Observer interface and after the function calls (create, remove, update, etc.) a notification is sent.
Is that a wise idea? If not, what can I do in order to send a notification to client?
I'm running JBoss 5 or Tomcat 6 (or both for easy deployment) and Apache Struts (though I don't see the reason why I mentioned it).
Thanks in advance.