7 Replies Latest reply on Apr 10, 2006 5:23 AM by Fane Babanu

    ejb3 best practice question

    Fane Babanu Newbie

      Hi,

      I have a set of entitites deployed on the server, with stateless session facade beans for communications with remote clients (using value objects). My entity-specific DAOs were injected in the session facades using @EJB annotation.
      I'm now in position of using this model in a web-app that will be deployed on the same server. Now, I was hoping that if the client app is now residing on the same server (same VM and everything) I would now have direct access to the model entities graph and that I wouldn't have to use value objects anymore. But I was unable to inject the DAOs in my (JSF) view beans; if I obtain them by JNDI, I still can't use lazy collections transparently so that means that I haven't made my life any easier and I could just as well use my old value-objects based interfaces.

      Sorry for the long post, hope you're still with me. My questions are:

      0) am I doing anything wrong?
      1) can I inject my DAOs in my web-app's view beans? how?
      2) can I use the model graph in my web-app directly, without having to do special workarounds for lazy collections? how?
      3) what is a "best practice" for this kind of situation?