Hello,
I am looking for correct design pattern which will allow me to access data via EJB remotly. I want to have a single point of enterance both for SEAM application and for other applications, which use the same data.
My current idea is to have:
- Stateless EJB acting as a DAO
- Stateful EJB, acting as a seam action
- JSF as a presentation layer
The stateful EJB calls the stateless to get the data. It also additionally has a remote interface which allows other application to call it. Due to convetions of seam I have to "double" the interface, for example:
@DataModel private List<Contact> contacts; @DataModelSelection private Contact contact; @Factory("contacts") public void findAll() { if(contacts == null) { contacts = myStatelessBean.findAll(); } } public List<Contact> getContacts() { findAll(); return contacts; }