beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie O'Neil <ekon...@gmail.com>
Subject control inheritance and client initializers
Date Thu, 10 Nov 2005 17:17:16 GMT
All--

  I've run into this entertaining problem with inheritance of controls
and generation of the ClientInitializer file.

  The situation is this:

class Super {
  @Control
  private EchoControl _echocontrol;

  protected String echo(String echoText) {
    return _echoControl.echo(echoText);
  }
}

class Sub extends Super {
  // note, no controls are used here, but the super.echo("") method is called
}

The Super class declares a private control and exposes it through a
protected method.  The Sub class declares no controls but uses the
protected method.  In this case, the Super class's _echoControl field
is never instantiated because the Sub class doesn't have a
ClientInitializer.

The problem is that the Sub class's ClientInitializer is only
generated when the control usage in a superclass is either public or
protected.  Seems that this should also include private controls as
they might still be exposed to subclasses through methods.

Personally, it seems like we should fix this -- any dissenting opinions?

Eddie

Mime
View raw message