Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Wicket and the Generics Battle (and a bit more)


Published on

What happened when generics was applied to Wicket... What should change..

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Wicket and the Generics Battle (and a bit more)

  1. 1. Wicket 1.4(generics)/1.5 Johan Compagner
  2. 2. Wicket and Generics Last year on stage the first big cut of generics was committed
  3. 3. Wicket and Generics What did happen?
  4. 4. Wicket and Generics Hell broke loooose...
  5. 5. 1.4 Generics Who uses 1.4 already? Who does like generics in wicket? Any suggestions for improvements?
  6. 6. My suggestions (to Sun) The class definition public class TextField <T> extends AbstractTextComponent<T> The constructor public TextField( final String id, IModel<T> model, Class<T> type)
  7. 7. My suggestions (to Sun) TextField<Integer> tf = new TextField<Integer> ( &quot;id&quot; , new Model<Integer>(), Integer. class ); Integer value = tf.getModelObject();
  8. 8. My suggestions (to Sun) TextField tf = new TextField( &quot;id&quot; , new Model<Integer>()) ; Integer value = tf.getModelObject() ; 1> Only declare it on one side 2> Better type inference based on what it gets (so from the Model) 3> No erasure, so be able to get the type from the instance.
  9. 9. My suggestions (to Sun) The Link class Some use it with an object others dont Link lnk = new Link(); Better type inference : No IModel default to void Or public abstract class Link<T default Void> extends AbstractLink
  10. 10. One tip for 1.4 Use Page.getPageReference() And PageReferene.getPage()
  11. 11. 1.5 We will not break the world (Matej told me that I had to say that) But loads of internals will be rewritten.
  12. 12. 1.5 Remove getDefaultModel() (introduced by generics 1.4) Auto detach of models that are held by any field.(maybe 1.4) Improved Markup Inheritance “ UrlBuilder”
  13. 13. 1.5... Any key things that should be done?