Martin Fowler: Humane Interface
Marttin Fowler has put a post up on his website that is causing quite a stir in the Java/Ruby world. The article is about creating what he calls a Humane Interface.
The essence of the humane interface is to find out what people want to do and design the interface so that it’s really easy to do the common case.
The obvious contrast to a minimal interface is that humane interfaces tend to be much larger, and indeed humane interface designers don’t worry too much about the interface being big. This isn’t to say that classes with humane interfaces need be larger in terms of implementation. The fundamental functionality of the two is often quite similar.
As an example, he contrasts the java.util.List class in Java with the Array class in Ruby. The first has 25 methods and the latter has 78. However, as I do not know Ruby, yet, I can not really comment on the example.
At the end of the article Fowler has a list of blog articles all written as a reaction to what he posted or to what other people have posted. Some agree with him and others oppose him. The comments and posts that I have read have all been excellent and have done a really good job of staying on topic. The posts are definitly educational.
The entire thing raises an interesting point, should a class only contain the bare minimum of methods to accomplish its task or should developers create methods simply for the sake of making the class easier and more humane to work with?