You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Daniel Rall <dl...@finemaltcoding.com> on 2002/04/11 03:07:12 UTC

[Stratum] Configuration interface

public interface Configuration
{
    Configuration subset(String prefix);

    boolean isEmpty();
    boolean containsKey(String key);
    void addProperty(String key, Object value);
    void setProperty(String key, Object value);
    void clearProperty(String key);
    Object getProperty(String key);
    Iterator getKeys(String key);
    Iterator getKeys();
    ...

Why does the Configuration interface name the method used to retrieve
the key set getKeys(), instead of keySet() (like the old
ExtendedProperties API, and the java.util.Map interface)?  Using the
getXxx() naming convention for non-JavaBean properties is a BIG no no
-- because getKeys() is overload (there's a a version which takes a
String parameter), you can't use it as a JavaBean property (so it
shouldn't be named as such).

Catalina's source is a good example of how to name method to be both
understandable and compatible with the JavaBean specification.  Note
that getXxx/setXxx methods are not overloaded anywhere (AFAIK).

- Dan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>