Name: gb36485 Date: 11/30/98
Currently, java interfaces only gracefully supports
*clients* of an interface. What about the poor soul
who has to *implement* the interface?
There are two user groups of a java interface.
(1) Clients who use the services of an interface
provider.
(2) Developers who implement the services.
Group (1) is served by the Public API.Group (2) should served by a different API with
additional implementation details/requirements.
Most of these extra details cannot currently be
specified, such as:
(a) Constructor arguments
(b) static methods
(c) static attributes
(d) methods with package/protected access.
For example:
interface FlyWeight_WholeValue_Label {
public static FlyWeight_WholeValue_Label newInstance( String label );
public boolean equal( Object obj );
public int hashCode();
/** each class implementing this interface MUST
* provide the following static attributes/methods,
* some would be public, most would not.
**/
protected FlyWeight_WholeValue_Label( String label );
static Hashtable register;
protected void register( String label );
private setRegister( Hashtable register );
}
Any derived class/interface could access 'protected'
methods,but only the first generation class could
access the private methods and attributes.
(Review ID: 25780)
======================================================================