Hi Joel,

I would suggest using a base class which implements the common functionality in a
generic way, combined with inner classes used as codeblocks (in the Smalltalk
tradition) which are passed to the baseclass, i.e. something like this:

public interface SqlStatment() {
  public Result execute();
};

public class MyEjbBase {
  public Result executeSql( SqlStatement s )
  {
    while ((retryCount < maxRetries) && (!success))
    {
      try {
        result = s.execute()
        success = true
      } catch(SqlException sqe) {
        retryCount = retryCount + 1
      } finally {
        ...
      }
      return result;
    }
  }
}

public class DerivedEjb extends MyEjbBase {
  public void ejbFindByPrimaryKey()
  {
    ...
    result = executeSql( new SqlStatement() { ... } );
    ...
  }
}

etc.

-Per

--
Per Spilling <[EMAIL PROTECTED]>
Objectware AS, Slemdalsveien 37, Pb. 137 Vinderen, 0319 Oslo, Norway
Tel: +47 23199200 Mobile: +47 90915115 Fax: +47 23199201

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to