Wicket Next (1.4/1.5)

6,131 views
6,042 views

Published on

Apache Wicket meetup Amsterdam 2008 roadmap presentation

Published in: Technology, Art & Photos
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,131
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
168
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Wicket Next (1.4/1.5)

  1. 1. Wicket NEXT Johan Compagner
  2. 2. Who is Johan Compagner <ul><li>Senior Java Developer at Servoy </li></ul><ul><li>10+ years of Java experience </li></ul><ul><ul><li>Swing and the Web (Struts/Tapestry) </li></ul></ul><ul><li>Core Wicket developer since September 2004 </li></ul>
  3. 3. Agenda <ul><li>Wicket 1.4 (GENERICS!!) </li></ul><ul><li>Wicket 1.5 (or 2.0) </li></ul><ul><li>Q&A </li></ul>
  4. 4. Wicket 1.4 <ul><li>Generics </li></ul><ul><ul><li>Model<T> </li></ul></ul><ul><ul><li>Component<T> </li></ul></ul><ul><ul><li>MetaData<T> </li></ul></ul>
  5. 5. Model<T> <ul><li>class IModel<T> { </li></ul><ul><li>T getObject() </li></ul><ul><li>void setObject(T) </li></ul><ul><li>} </li></ul><ul><li>Model<String> model = new Model<String>(“Wicket”); </li></ul><ul><li>String str = model.getObject(); // no cast. </li></ul>
  6. 6. Component<T> <ul><li>Why the need to generify Component? </li></ul><ul><ul><li>IModel parameter in constructor. </li></ul></ul><ul><ul><ul><li>public Component(String id, IModel<T> model) </li></ul></ul></ul><ul><ul><li>set/getModel() methods </li></ul></ul><ul><ul><ul><li>public Component<T> setModel(IModel<T> model) </li></ul></ul></ul><ul><ul><ul><li>public final IModel<T> getModel() </li></ul></ul></ul><ul><ul><li>getModelObject() </li></ul></ul><ul><ul><ul><li>public final T getModelObject() </li></ul></ul></ul>
  7. 7. Component<T> <ul><li>TextField<Double> tf = new TextField<Double>(“txt”,Double.class) </li></ul><ul><ul><li>Double.class still needed for converter.. </li></ul></ul><ul><li>Also makes it more clear what components really want like ListView: </li></ul><ul><ul><li>ListView<T> extends AbstractRepeater<List<T>> </li></ul></ul><ul><ul><li>public ListView(String id, IModel<List<T>> model) </li></ul></ul><ul><li>And my personal favorite: </li></ul><ul><li>public DropDownChoice(String id,IModel<T> model, </li></ul><ul><li>IModel<List<T>> choices, IChoiceRenderer<T> renderer) </li></ul><ul><li>public ListMultipleChoice(String id, IModel<Collection<T>> model, </li></ul><ul><li>IModel<List<T>> choices, </li></ul><ul><li>IChoiceRenderer<T> renderer) </li></ul>
  8. 8. Wicket 1.4 what more.. <ul><li>A little bit more generics here and there </li></ul><ul><ul><li>MetaData without generics: </li></ul></ul><ul><ul><ul><li>MetaDataKey PERMISSION = new MetaDataKey(Permission. class ); </li></ul></ul></ul><ul><ul><ul><li>Permission p = (Permission)session.getMetaData(PERMISSION); </li></ul></ul></ul><ul><ul><li>With generics: </li></ul></ul><ul><ul><ul><li>MetaDataKey<Permission> PERMISSIONS = new MetaDataKey<Permission>(); </li></ul></ul></ul><ul><ul><ul><li>Permission p = session.getMetaData(PERMISSION); </li></ul></ul></ul><ul><ul><li>Varargs.. </li></ul></ul><ul><ul><ul><li>MarkupContainer.add(Component... childs) </li></ul></ul></ul><ul><ul><ul><li>Component.add(IBehavior... behavior) </li></ul></ul></ul><ul><li>Some API breakage compared to 1.3 to fix some bugs and cleanup some API. </li></ul><ul><ul><li>So no drop in replacement! </li></ul></ul>
  9. 9. Wicket 1.4, WHEN!?! <ul><li>NOW!!! (or almost, start commit now!) </li></ul><ul><ul><li>At least in svn (trunk) </li></ul></ul><ul><ul><li>Or snapshot release (if bambo works out) </li></ul></ul><ul><ul><li>Not a release yet in a few weeks first milestone build. </li></ul></ul>
  10. 10. Wicket 1.5/2.0 <ul><ul><li>Don't hold me responsible if some of the next mentioned features don't make it! </li></ul></ul>
  11. 11. Inheritance Improvement <ul><li>Multiply extend/child area's </li></ul><ul><li><html><body> </li></ul><ul><li>This is in the super markup.<wicket:child />This is in the super markup. </li></ul><ul><li></body></html> </li></ul><ul><li><html><body> </li></ul><ul><li>This is in the child markup. </li></ul><ul><li><wicket:extend>This is in the child markup.</wicket:extend> </li></ul><ul><li>This is in the child markup. </li></ul><ul><li></body></html> </li></ul><ul><li><html><body> </li></ul><ul><li>This is in the super markup. </li></ul><ul><li>This is in the child markup. </li></ul><ul><li>This is in the super markup. </li></ul><ul><li></body></html> </li></ul>
  12. 12. Inheritance Improvement <ul><li><html><body> </li></ul><ul><li>This is in the super markup.<wicket:child name=”child1”/> </li></ul><ul><li>This is in the super markup.<wicket:child name=”child2”/> </li></ul><ul><li></body></html> </li></ul><ul><li><html><body> </li></ul><ul><li>This is in the child markup. </li></ul><ul><li><wicket:extend name=”child1”>This is in the child1 markup.</wicket:extend> </li></ul><ul><li>This is in the child markup. </li></ul><ul><li><wicket:extend name=”child2”>This is in the child2 markup.</wicket:extend> </li></ul><ul><li></body></html> </li></ul><ul><li><html><body> </li></ul><ul><li>This is in the super markup. This is in the child1 markup. </li></ul><ul><li>This is in the super markup. This is in the child2 markup. </li></ul><ul><li></body></html> </li></ul>
  13. 13. Inheritance Improvement <ul><li>Childs can come from different sub pages. </li></ul><ul><li>Can have multiply childs itself again. </li></ul>
  14. 14. ProxyModel <ul><li>A Model based on invocation recording. </li></ul><ul><li>Generates string expressions for the existing PropertyModel </li></ul><ul><li>SafePropertyModel<Person> p = new SafePropertyModel<Person>(new Person()); </li></ul><ul><li>TextField field = new TextField(&quot;name&quot;, p.bind(p.toProperty().getFirstName())); </li></ul>
  15. 15. ProxyModel <ul><li>Generates byte code that is a Macro </li></ul><ul><li>SafePropertyModel<Person> p = new SafePropertyModel<Person>(new Person()); </li></ul><ul><li>TextField field = new TextField(&quot;name&quot;, p.bind(p.toProperty().getAddress().getCity())); </li></ul><ul><li>class Macro implements IPropertyInvoker { </li></ul><ul><li>void setObject(Object rootObject, Object value) { </li></ul><ul><li>Address address = ((Person)rootObject).getAddress(); </li></ul><ul><li>if (address != null) address.setCity((City)value); </li></ul><ul><li>} </li></ul><ul><li>Object getObject(Object rootObject) { </li></ul><ul><li>Address address = ((Person)rootObject).getAddress(); </li></ul><ul><li>if (address != null) return address.getCity(); </li></ul><ul><li>return null; } </li></ul><ul><li>Almost no state to keep, the state is a class that is shared </li></ul><ul><li>Build on top of commons-proxy (and needs proxy/codegen classes) </li></ul><ul><li>Most likely not in core but in a separate project. </li></ul>
  16. 16. Validators/Behaviors <ul><li>Validator should also be able to contribute to the markup. </li></ul><ul><li>Class MyLengthValidator implements IContributeBehaviorValidator </li></ul><ul><li>{ </li></ul><ul><li>void validate(IValidatable validatable) { </li></ul><ul><li>String str = validatable.getValue(); </li></ul><ul><li>if (str.length() > length) error(); </li></ul><ul><li>} </li></ul><ul><li>IBehavior getBehavior() { </li></ul><ul><li>return SimpleAttributeModifier(“maxlength”,length); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  17. 17. Wicket 1.5/2.0 <ul><li>Window support (PageMap replacement) </li></ul><ul><ul><li>A sub session for every tab in a browser. </li></ul></ul><ul><li>More URL improvements </li></ul><ul><ul><li>So that it becomes easier to use any URL encoding for everything (stateless forms etc) </li></ul></ul><ul><li>CompoundAjaxBehavior </li></ul><ul><ul><li>More then 1 action under 1 event. </li></ul></ul><ul><li>Development Mode dashboard widget </li></ul><ul><ul><li>Combination of InspectorBug and AjaxDebug </li></ul></ul><ul><li>Resource/IResourceStream cleanup </li></ul>
  18. 18. Wicket Testing <ul><li>WicketTester improved or replaced completely. </li></ul><ul><li>JDave/Hamcrest style testing </li></ul>
  19. 19. Wicket Security <ul><li>Swarm/Wasp moved to Apache </li></ul>
  20. 20. Q/A <ul><li>Do you guys want even more? </li></ul>

×