Wicket and the Generics Battle (and a bit more)

1,861 views
1,828 views

Published on

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

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,861
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
22
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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?

×