Take for example Spring and dependency injection. Spring is BIG, there’s a lot to it, but the concept is simple: use a factory of some sort to build your application by injecting all its dependencies and do it in the simplest way possible. Or, to put it another way, don’t use new. For most reasonably good programmers, with a grasp of OO and Java, absorbing this concept should be fairly trivial.
Compare that with some other, less well known APIs. Yesterday’s blog, for example, touched on AOP and AspectJ. This is a great tool there’s no mistake about that, but the concept is not so trivial. You go from a linear programming to a non-linear programming world, where by method calls are magically intercepted at certain points in your code with just a little config and few annotations. Also compare the language of each domain. AspectJ has JoinPoint, Advice, Aspect and Intertype Declarations, whilst Spring uses Factory, Bean and MVC. Comparing the two domain word groups, Spring’s is a far easier to get to grips with. I’m willing to bet that all reasonable programmers will relate to Factory and Bean and most programmers who have worked on a Web app will understand the idea of MVC. On the other hand, AspectJ’s domain language is pretty cryptic; the words Joinpoint or Aspect don’t really convey much meaning in themselves.
This has lead me to formulate the 10 minute concept rule which goes something like this:
For an API to be successful, the basic theory or concept should be understandable by an “average programmer” within about 10 minutes.
...and remember, we’re all average.
No comments:
Post a comment