4 Replies Latest reply on Sep 22, 2002 12:07 AM by Paul Sabadin

    Eficiency, CMR, CMP, Local IF, Lazy Loading, Pooling, EJBLoa

    Paul Sabadin Newbie

      Assume that all entity access is via Local interfaces (starting from a session facade) and in the same transaction, relies on lazy loading, uses CMR/CMP, etc. within JBoss 3.0.x.

      Is the following simulation of EJB inheritance with a fine-grained object model still a major no-no? I'm thinking that this approach is OK BECAUSE of the above mentioned container technologies. Please set me straight if I am messed up. (I would love to hear from dsundstrom as well.)

      Pseudo-code for EJB inheritance:

      public abstract class PatientBean
      implements EntityBean {

      ...

      // ejb-jar.xml not shown but assumed correct and optimal

      // CMR for Person simulating PersonBean BASE CLASS (delegation)
      public abstract void setPerson(PersonLocal lEntity);
      public abstract PersonLocal getPerson();

      // ? HERE IS THE QUESTION. THIS SIMULATES INHERITANCE
      // AND IS A CMP GETTER/SETTER FOR A BASE CLASS (Person) ENTITY
      // EJB ATTRIBUTE. IS THIS OK OR TRULY A SCALABILITY
      // ISSUE?
      public String getFirstName()
      {
      return getPerson().getFirstName();
      }

      public void setFirstName( String pFirstName )
      {
      getPerson().setFirstName(pFirstName);
      }

      // Typical CMP getter for derived (Patient) entity
      // (shown here for completenes and contrast);
      public abstract void setGender( char pGender );

      ...
      }

      Please keep it tight (answer only question asked) and don't go off topic for this post.

      Thanks in advance!
      Paul