The existing Swing TreeModel interface is incomplete, lacking important methods, such as those for inserting and removing nodes. As a result, developers either have to extend the interface and take the responsibility of model management upon themselves, or they have to forget the interface, and limit themselves to DefaultTreeModel. Even in the latter case, the onus for calling DefaultTreeModel methods, such as nodesWereInserted and nodesWererRemoved, lies on developers, unless they code directly to the DefaultTreeModel API (calling insertNodeInto or removeNodeFromParent). Unfortunately, by doing so, they foreclose their ability to use a custom tree model class that does not extend DefaultTreeModel.
What do people think of an extended tree model interface (e.g., MutableTreeModel) that fixes these problems? If done right, it should make it possible for people to code only to the interface, not to the actual implementation.
The interface would be backward compatible in that any code that expects a TreeModel would accept MutableTreeModel. Does it make sense to pursue model extensions like this?