Friday, May 8, 2009

Book Review: Practical API Design: Confessions of a Java Framework Architect

Book Review: Practical API Design: Confessions of a Java Framework Architect by Jaroslav Tulach: Publisher- Apress: ISBN- 13: 978-1-4302-0973-7

Before start reading Practical API Design, I googled and not able to find much of stuff on API design. Only worth while to mention are discussion on Artima forum dated 2005 and a paper by Brian Ellis, Jeffrey Stylos, Brad Myers. Certainly Effective Java Joshua Bloch also discusses the topic. I was surprised and started reading the book.

Once I started the book I was hooked to it. This book is written clearly demarcated three parts: Theory, Design aspects and Advice characterized as Theory & Justification, Practical Design and daily Life.

As confessed by Tulach book covers only Java language specifics but still book is must read for non java professionals.

Book primarily focuses on few topics: Evolve-ability, Backward & forward compatibility, architecture by committee and lessons learnt from NetBeans API development.

The book is serious readers and those who like to read book with notebook and pencil. This book is not easy read which you can read during your lunch. It needs serious time and efforts to read and then grasps. It discusses various aspects of API design with respect to backward & forward compatibility, runtime behavior, testability, separation of API & SPI, mingling with other APIs (here certainly I recommend reads to look into Struts 2.x and Grails architecture, design and source, because these frameworks/API uses third party libraries extensively), interface vs. abstract classes etc.

Tulach has recommended not to rewrite because of breaking old loyal clients. Personally, I also subscribed to this line of thought but certainly Struts 2.x violets this line and still very successful. It has to be studied in details.

Though book is comprehensive but it has not covered few topics:

1. Effect of hard coding of SUID (static final long serialVersionUID =xx)
2. Performance
3. How to make API accessible from different programming languages (say C#)

Tulach is maintaining books web presence at http://www.apidesign.org, I hope he will take care of the different views and uncharted topics in future.

I am hoping for similar book by other veterans of industry both open source & proprietary frameworks and APIs (Eclipse, Spring, Hibernate, jUnit, Glassfish, Ant, Struts, Groovy on the Grails) as well as non Java frameworks and APIs (Ruby on the Rails , AspectDNG, Netron graph library, NAnt).

Practical API Design must be in your bookshelf if you are java architects veterans or aspiring one. It is also a good reference book for non java folks as principles discussed are very much applicable in other languages but must be tweaked to adjust with language specifics.

Disclaimer: I did not get paid to review this book, and I do not stand to gain anything if you buy the book. I have no relationship with the publisher or the author.

Further reading: A competing book is Effective Java by Joshua Bloch

One can get more information about book and related topics from:

1. Book’s web presence at http://apidesign.org
2. Purchase book at Amazon
3. Publisher -- Apress
4. Interview with Author
5. Review at 72 Miles
6. 90th Percentile Blog
7. The Factory Pattern in API Design: A Usability Evaluation by Brian Ellis, Jeffrey Stylos, Brad Myers
8. Discussion on API Design
9. Java Language Specification, Chapter 13: Binary Compatibility

No comments:

Post a Comment