文档介绍:1 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved. | Insert Information Protection Policy Classification from Slide 8
Paradoxes of API Design
Jaroslav Tulach
NetBeans Platform Architect
2 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved. | Insert Information Protection Policy Classification from Slide 8
Motto
Just like there is a difference between
describing a house and a Universe,
there is a difference between
writing a code and producing an API!
3 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved. |
Paradox
Is paradox unnatural?
● Crossing the knowledge horizon
● Fear of unknown vs. I know it “all” mode
● Expectation vs. reality
● The less “fear” the more paradoxes
● Software knowledge
● School
● In-house development
http://wiki./wiki/Paradox
● Framework
4 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Who Are Your Users?
Rationalists?
Empiricists!?
Clueless!
5 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Selective Cluelessness
One cannot understand everything!
● Understanding is limited
● Takes time
● Brain is finite
● Not necessary to understand everything
● Linux, Java VM, Tomcat, servlet, DB on stack - learn just the API
facade
● Minimize understanding!
● Make it increasable! http://wiki./wiki/Cluelessness
6 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
What is an API?
Just like writing a book
● One writer
● Design mittee?
● Many readers
● Unknown to the writer - envisioned by use-cases
● Best-seller
● Speak clearly
● Build on reader's knowledge
http://wiki./wiki/APITypes
● Keep consistency
7 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Maintaining an API
Develop and sustain!
● Write once and publish
● Creativity is good – strive for elegance
● Switch to sustaining mode
● Preserve (unknown) investments made b