Wednesday, February 04, 2009 4:19 PM | rahel luethy | 1 comment(s)

generified

one of the java language features which i personally discovered quite late and use only very rarely, but which maybe still is a good addition to any developer's toolbox: the possibility to specify multiple bounds for a type parameter via the T extends T1 & T2 ... & Tn syntax.

a simple example:

instead of typing the dialog to e.g. a DisposablePanel class, we use multiple bounds to combine the two roles dynamically (and thus keep the class hierarchy cleaner).

2:16 PM | Blogger David Moles said...

Note that it doesn't always do as much as it ought to, though.