I realy would like "Replace Inheritance with Delegation" refactory.
http://www.refactoring.com/catalog/replaceInheritanceWithDelegation.html

Joshua Bloch describe in his book Effective Java some of the benifits of
using composition over inheritance, but I find it somtime a pain to write
all the forwarding methods.


Example:

class Test extends ArrayList
{
...
}

=>

class Test implements List, Cloneable, java.io.Serializable
{
    private ArrayList _arrayList = new ArrayList();

    public void trimToSize() {
        _arrayList.trimToSize();
    }

    ...
}


Michael Bertelsen
SPSS Inc.


_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features

Reply via email to