Presentation is loading. Please wait.

Presentation is loading. Please wait.

Service Side Ajax Richard Schmidt gmail. Com Metservice.

Similar presentations


Presentation on theme: "Service Side Ajax Richard Schmidt gmail. Com Metservice."— Presentation transcript:

1 Service Side Ajax Richard Schmidt hangstrap @ gmail. Com Metservice

2 Our Situation / Requirement Rich(ish) Application. Easy to deploy / standard browser. Not many users.  Max 50 sessions  Very little concurrency Hardware costs are not important. Main cost is developer salaries.

3 Some Web Frameworks JSF (yea right!)‏  Ajax? Tapestry, Wicket  Component based. Flex  Another language GWT  Scaled down Java Java client (applet / web start)‏  Will the client have JAVA installed? Something else?

4 Server Side Ajax Server downloads a javascript app. to browser. Server then sends list of components that javascript app. renders in the browser. User events are sent back to server using Ajax. Server processes events and then send changes to components back to client...

5 Advantages Only one language Can use full features of Java  not like GWT No writing of HTML or Javascript! Write using components that fire events.  Swing like. KISS: One less physical layer All code runs on one VM, easier to debug, test etc.

6 Disadvantages Each user has a large session variable.  Not going to work for Google! More network traffic to / from server.  (but not much more!)‏ Not mainstream technology. 'Stuck' with the basic components supplied by the framework. Set of components – still have to write a application framework! Different browsers.

7 Players Thinwire  Stable, not much development. Echo2/3  Well known. Wing-S  Based on Swing components. J-Seamless  Uses Flex as a renderer. ULC Canoo  Commercial, Java proxy on client  Test framework, visual editor, support, rich functionality.

8 public static void main(String[] args) { //Create and set initial position for components final Dialog dialog = new Dialog("Hello World, ThinWire Style!"); Label label = new Label("Hello, what is your name?"); final TextField input = new TextField(); Button button = new Button("Ok"); //When button is clicked, close modal dialog and say hello button.addActionListener("click", new ActionListener() { public void actionPerformed(ActionEvent ev) { MessageBox.confirm("Hello " + input.getText() + "!"); dialog.setVisible(false); } }); //Add components to dialog dialog.getChildren().add(label); dialog.getChildren().add(input); dialog.getChildren().add(button); //Show dialog and wait for "OK" press dialog.setVisible(true); } Code Example

9 Using Beans Binding ATestBean bean = new ATestBean(); Property pt1Client = BeanProperty.create("enabled"); TextField tf = new TextField(); Property tfProp = BeanProperty.create("enabled"); Binding binding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, bean, pt1Client, tf, tfProp); binding.bind();

10 Demos Echo2 Wing-S Canoo ULC Our App


Download ppt "Service Side Ajax Richard Schmidt gmail. Com Metservice."

Similar presentations


Ads by Google