Wicket   and Swing from one code base Johan Compagner
Who is Johan Compagner <ul><li>Senior Java Developer at Servoy (and Topicus) </li></ul><ul><li>10+ years of Java experienc...
Agenda <ul><li>How does Servoy work. </li></ul><ul><li>Wicket/Web compared to Swing. </li></ul><ul><li>One codebase -> 2 C...
How does Servoy work <ul><li>Own  Drag'N'Drop RAD IDE </li></ul><ul><li>Developers use Javascript to code. </li></ul><ul><...
The IDE
The Eclipse Servoy IDE
Wicket compared to Swing <ul><li>Both component based (MVC) </li></ul><ul><li>Wicket even “more” MVC  then  Swing. </li></...
One codebase -> 2 clients <ul><li>We kept the Model part of the MVC. </li></ul><ul><li>Controller and View are generated b...
The Controller part <ul><li>IComponentFactory </li></ul><ul><ul><li>IButton createButton(..); </li></ul></ul><ul><li>2 Com...
The View part <ul><li>Swing has this build in (the controller) </li></ul><ul><li>Template Generator </li></ul><ul><ul><li>...
Use of AJAX <ul><li>All events are done by AJAX. </li></ul><ul><li>Basic AJAX support build in a few days.. </li></ul><ul>...
ChangeRecording <ul><li>AJAX event is coming in. </li></ul><ul><li>Calls the events method. </li></ul><ul><li>All componen...
The Result (Swing)
The Result (Web)
Q/A <ul><li>? </li></ul>
Upcoming SlideShare
Loading in …5
×

Wicket And Swing From One Codebase

4,054 views

Published on

Wicket and Swing very alike

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

  • Be the first to like this

No Downloads
Views
Total views
4,054
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
144
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Wicket And Swing From One Codebase

  1. 1. Wicket and Swing from one code base Johan Compagner
  2. 2. Who is Johan Compagner <ul><li>Senior Java Developer at Servoy (and Topicus) </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>How does Servoy work. </li></ul><ul><li>Wicket/Web compared to Swing. </li></ul><ul><li>One codebase -> 2 Clients </li></ul><ul><li>Q&A </li></ul>
  4. 4. How does Servoy work <ul><li>Own Drag'N'Drop RAD IDE </li></ul><ul><li>Developers use Javascript to code. </li></ul><ul><ul><li>Those scripts are attached to events (onaction) </li></ul></ul><ul><ul><li>Those scripts can alter the form components. </li></ul></ul><ul><li>Repository based, no code generation. </li></ul><ul><li>First only a Swing rich client (via webstart) </li></ul><ul><li>Web client introduced in 2005 </li></ul><ul><li>Full AJAX based webclient in 2006 </li></ul>
  5. 5. The IDE
  6. 6. The Eclipse Servoy IDE
  7. 7. Wicket compared to Swing <ul><li>Both component based (MVC) </li></ul><ul><li>Wicket even “more” MVC then Swing. </li></ul><ul><li>Pull against Push. </li></ul><ul><li>Swing has setLocation/setBackground/Ect. </li></ul><ul><li>Swing is richer (even when using AJAX) </li></ul><ul><li>Web has browsers.... </li></ul>
  8. 8. One codebase -> 2 clients <ul><li>We kept the Model part of the MVC. </li></ul><ul><li>Controller and View are generated based on client type. </li></ul>
  9. 9. The Controller part <ul><li>IComponentFactory </li></ul><ul><ul><li>IButton createButton(..); </li></ul></ul><ul><li>2 Component Factories </li></ul><ul><ul><li>SwingComponentFactory </li></ul></ul><ul><ul><li>WicketComponentFactory </li></ul></ul><ul><li>Swing Button uses ActionListener interface. </li></ul><ul><li>Wicket Button generates onclick attribute. </li></ul>
  10. 10. The View part <ul><li>Swing has this build in (the controller) </li></ul><ul><li>Template Generator </li></ul><ul><ul><li>HTML per form. </li></ul></ul><ul><ul><li>CSS per form. </li></ul></ul><ul><li>Custom IResourceStreamLocator </li></ul>
  11. 11. Use of AJAX <ul><li>All events are done by AJAX. </li></ul><ul><li>Basic AJAX support build in a few days.. </li></ul><ul><li>But.. a Servoy developer can do anything in a script. </li></ul><ul><ul><li>button.setLocation/button.setBackground. </li></ul></ul>
  12. 12. ChangeRecording <ul><li>AJAX event is coming in. </li></ul><ul><li>Calls the events method. </li></ul><ul><li>All components are recording the changes when touched </li></ul><ul><li>An IVisitor walks over the page collecting the changed components. </li></ul><ul><li>And are added to the AjaxRequestTarget. </li></ul>
  13. 13. The Result (Swing)
  14. 14. The Result (Web)
  15. 15. Q/A <ul><li>? </li></ul>

×