Ostrava

From APIDesign

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
[[Ostrava]] is 3rd largest town in Czech Republic. I visited [[wikipedia:Ostrava|Ostrava]]'s [http://java.cz/article/czjug-ostrava-brezen-2011 JUG meeting] on Mar 2nd, 2011.
[[Ostrava]] is 3rd largest town in Czech Republic. I visited [[wikipedia:Ostrava|Ostrava]]'s [http://java.cz/article/czjug-ostrava-brezen-2011 JUG meeting] on Mar 2nd, 2011.
-
[[Image:Ostrava-jug.jpg]]
+
[[Image:Ostrava-jug.jpg|right|thumb]]
 +
[[Image:OstavaAJa.jpg|right|thumb]]
-
I talked about [[paradox]]es, in a shorter version of the [[ParadoxesVideo]].
+
I talked about [[paradox]]es, in a shorter version of the [[ParadoxesVideo]]. Here is the video from the presentation (only for Czech speakers):
 +
 
 +
{{#ev:vimeo|21430542}}
-
[[Image:OstavaAJa.jpg]]
 
Those who stopped by (and there was about 90 listeners) got a chance to win one copy of [[TheAPIBook]] by finding an answer to a simple quiz: Can you write a code that throws ''NullPointerException'' directly from the following ''Interval'' class?
Those who stopped by (and there was about 90 listeners) got a chance to win one copy of [[TheAPIBook]] by finding an answer to a simple quiz: Can you write a code that throws ''NullPointerException'' directly from the following ''Interval'' class?

Revision as of 09:12, 13 April 2011

Ostrava is 3rd largest town in Czech Republic. I visited Ostrava's JUG meeting on Mar 2nd, 2011.

thumb thumb

I talked about paradoxes, in a shorter version of the ParadoxesVideo. Here is the video from the presentation (only for Czech speakers):


Those who stopped by (and there was about 90 listeners) got a chance to win one copy of TheAPIBook by finding an answer to a simple quiz: Can you write a code that throws NullPointerException directly from the following Interval class?

does not exists: interval.api

When writing the code I tried to follow all the good advices of TheAPIBook. I made the class final, I check for wrong arguments. My internal state is immutable. I guard myself against mutability of Date. Is it enough to write bullet proof code?

Indeed it is not. As about five people during my Paradoxes talk in Ostrava found out (and as few of you commented online), one can subclass Date and override clone method to return null:

does not exists: interval.exploit

This is an interesting way to break many solid APIs. The trick has been invented by the HP guys when they played their HPAPIFest09. I am glad Ostrava discovered the magic as well. I am glad I could visit Ostrava's JUG and talk about my two favorite topics: API design and NetBeans platform.

Personal tools
buy