11 - 15 DECEMBER ANTWERP BELGIUM. Server Side Scripting: Project Phobos Ludovic Champenois Senior Staff Engineer Sun Microsystems.

Slides:



Advertisements
Similar presentations
® IBM Software Group Copyright © 2005 IBM Corporation AJAX Toolkit Framework Emerging Internet Technologies Group.
Advertisements

Web Toolkit Julie George & Ronald Lopez 1. Requirements  Java SDK version 1.5 or later  Apache Ant is also necessary to run command line arguments 
Java Script Session1 INTRODUCTION.
LHCbPR V2 Sasha Mazurov, Amine Ben Hammou, Ben Couturier 5th LHCb Computing Workshop
® Emerging Internet Technologies © Copyright 2007 IBM Corp. ; made available under the EPL v1.0 AJAX Toolkit Framework Robert Goodman
UNIT4 BUSINESS ANALYTICS. page WHAT IS THE PRODUCT? 2 A business intelligence tool kit, specializing in Coporate Performance Management An application.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
Web 2.0 with AJAX Students : LASC Ioana KELEMEN Csilla POP Dan Adrian CIOBANU Dumitru Daniel Project leader : Ahmed RHIAT.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
© Internna Technologies 1 IWebMvc Features, Possibilities & Goals.
© 2006 by IBM 1 How to use Eclipse to Build Rich Internet Applications With PHP and AJAX Phil Berkland IBM Software Group Emerging.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
1. 2 What’s New in NetBeans IDE What is NetBeans IDE?  Ready to use out of the box  Support for latest Java specifications & standards  Other.
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
Applets & Servlets.
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
Embedded Reporting for Data Visualization Robin Davies Director Sales Jinfonet Software Rockville, MD Greg Harris Product Engineer Jinfonet Software Rockville,
Google Web Toolkit An Overview By Shauvik Roy Choudhary.
CHEF II / Sakai Architecture. CHEF II Changes uPortal replaces Jetspeed –jsr 168 portlet, servlet compliant Spring replaces Turbine component framework.
DEV-5: Introduction to WebSpeed ® Stephen Ferguson Sr. Training Program Manager.
Cross Site Integration “mashups” cross site scripting.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
Copyright © 2012 UNICOM Systems, Inc. Confidential Information z/Ware Product Overview illustro Systems International A Division of UNICOM Global.
PHOBOS Javascript Engine By Daniel Reeves. What is Phobos? Lightweight application framework for Java Used by NetBeans Supports multiple scripting languages.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
® Emerging Internet Technologies © Copyright 2007 IBM Corp. ; made available under the EPL v1.0 AJAX Toolkit Framework Robert Goodman
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Google Web Toolkit for Mobile Applications Development INGENUITY AT ITS BEST……………….
Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
INTRODUCING HYBRID APP KAU with MICT PARK IT COMPANIES Supported by KOICA
1 Cutting Edge FE technologies for complex product August 6, 2015.
Portlet Development Konrad Rokicki (SAIC) Manav Kher (SemanticBits) Joshua Phillips (SemanticBits) Arch/VCDE F2F November 28, 2008.
Speaker Name Speaker Title Speaker Title Oracle Corporation Olivier Le Diouris Principal Product Manager Oracle Corporation Building Servlet and JSP Applications.
Technologies For Creating Rich Internet Applications Presenter's name
1 NetBeans New and Cool Sun Microsystems, Inc.. 2 Goal of the Talk Learn how NetBeans IDE can help you become more productive Learn about the new features.
GlassFish Workshop 1 Dynamic Languages in GlassFish Arun Gupta blogs.sun.com/arungupta.
Lotus Symphony Extension Model ● Jin Hua, Chen ● IBM.
JMaki, Phobos Ludovic Champenois Sun Microsystems Tools story February 23, 2007.
INNOV-16: Rich User Interface for the Web???? AJAX to the Rescue Ken Wilner VP of Technology Progress Software.
jMaki: The power of Ajax made easy
Plateform for Enterprise Solution: Java EE5
The Share Widget Library
Netscape Application Server
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
Google Web Toolkit Tutorial
Play Framework: Introduction
Scripted Page Web App Development (Java Server Pages)
Web Software Model CS 4640 Programming Languages for Web Applications
Google Web Toolkit - Gufran Mohammed
Introduction to JSP Liu Haibin 12/09/2018.
Ruby, Rails, GUIs, and More
Unit 6-Chapter 2 Struts.
Web App vs Mobile App.
Design and Maintenance of Web Applications in J2EE
DWR: Direct Web Remoting
Lecture 1: Multi-tier Architecture Overview
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
Google App Engine Ying Zou 01/24/2016.
JavaServer Faces: The Fundamentals
AJAX Toolkit Framework
Enterprise Java Beans.
Introducing Java.
CS4961 Software Design Laboratory Understand Aquila Backend
Web Client Side Technologies Raneem Qaddoura
Presentation transcript:

DECEMBER ANTWERP BELGIUM

Server Side Scripting: Project Phobos Ludovic Champenois Senior Staff Engineer Sun Microsystems

DECEMBER ANTWERP BELGIUM Overall Presentation Goal Learn why JavaScript is relevant on the server side...as well as the client side Learn how to use JavaScript on the server side

DECEMBER ANTWERP BELGIUM Speaker’s Qualifications Senior architect at Sun Microsystems and...  Java EE 5, GlassFish, NetBeans, jMaki, Phobos  Tools developer Ludo wrote a Java EE book  NetBeans IDE field guide Ludo speaks French Ludo speaks Tools  GlassFish Eclipse:-) plugin

DECEMBER ANTWERP BELGIUM What Gartner thinks of JavaScript ” JavaScript on servers will emerge as one of several programming models popularized by Web platforms by 2009 (0.7 probability). ” (November, 21, 2006)

DECEMBER ANTWERP BELGIUM JavaScript Most visible technology for Web 2.0 Around for almost 10 years In all relevant browsers Now in JDK Server side JS in Netscape Enterprise Server (1998-) Emerging affinity between Client and Server Not Evil, especially on the server side

DECEMBER ANTWERP BELGIUM JavaScript Tools Browsers centric  Venkman  Firebug (Written in JS, XUL UI) IDEs  IntelliJ, Eclipse, NetBeans  Scripting languages support: Key feature for the brand new NetBeans editor framework  Inline errors, code completion, debugger  Embedded editors

DECEMBER ANTWERP BELGIUM Project Phobos Lightweight web application framework Runs on the Java platform Runs embedded (With Grizzly) Complementary to existing technologies Supports multiple scripting languages Current focus is on JavaScript Bottom-up framework development

DECEMBER ANTWERP BELGIUM Target Audience Web application developers With a need for agility of scripting Feeling pain from compile/deploy cycle (especially true with Ajax) Glueing things together With investment in Java Libraries, EE servers/resources, Interop Seeking proven, high-performance deployment platform

DECEMBER ANTWERP BELGIUM Phobos Goal Deliver a great developer experience Tune your server logic while it is running:  Save the script  Reload the page that interacts with it

DECEMBER ANTWERP BELGIUM Architecture APPLICATION SERVER, WEB CONTAINER, HTTP connector (embedded or not) SCRIPTING LIBRARIES SCRIPTS VIEWS AJAX LIBRARIES JAVA LIBRARIES JAVA PLATFORM SCRIPTING ENGINES TEMPLATES, STATIC CONTENT, ADDITIONAL LIBRARIES... PHOBOS ADAPTER CONTROLLER S

DECEMBER ANTWERP BELGIUM Performance: grizzly+Javacript jRuby: Apache bench:( Server Software: WEBrick/1.3.1 Requests per second: 7.20 [#/sec] (mean) Server Software: Grizzly/1.0.4 Requests per second: [#/sec] (mean) GlassFish V3 early prototype: Starts Phobos engine in 0.8 seconds

DECEMBER ANTWERP BELGIUM Programming Model Less prescriptive than ROR Meaningful directory structure HTTP-centric Map out the URLs Attach logic to them Test out interactively REST modeled directly Background tasks, AJAX support, etc. Freely use Java APIs

DECEMBER ANTWERP BELGIUM Application Layout /application /controller mycontroller.js /module application.js /script index.js hello.rb /template /view layout.ejs myview.ejs /static /dojo dojo.js /css main.css faq.html release_notes.html /environment development.js startup-glassfish.js

DECEMBER ANTWERP BELGIUM Application

DECEMBER ANTWERP BELGIUM Where does the logic go? Three choices:  Plain scripts  Controllers  Resources Different URL “shapes”:  /doSomething.js  /store/display_cart  /catalog/isbn/ These reflect how people think of URLs Custom mappings (choice #4)

DECEMBER ANTWERP BELGIUM #1 - Plain Scripts Servlet-like programming No need to extend servlet base class Request/response bound to variables response.setStatus(200); response.setContentType("text/html"); writer = response.getWriter(); writer.println( Hello from Javascript Hello from Javascript! ); writer.flush();

DECEMBER ANTWERP BELGIUM #2 - Controllers MVC framework Controllers are JavaScript classes Action handlers are methods Views are scripts URL mapping: User-specified mappings possible, e.g.

DECEMBER ANTWERP BELGIUM Sample Controller Var mycontroller = function() { this.Main = function() { this.frontpage = function () { library.view.render("frontpage.ejs"); } }; library.common.define(controller,"main", mycontoller); → /main/frontpage

DECEMBER ANTWERP BELGIUM Embedded Javascript (.ejs) Templating system for views Embed Javascript statements: Or expressions: No mandated way to share state between controller and views  Conventionally, use model global variable

DECEMBER ANTWERP BELGIUM #3 - Resources REST framework Resources are classes Methods are HTTP methods Code deals with HTTP entities Many HTTP aspects offloaded to framework Atom Protocol server as testbed Plan to investigate WADL

DECEMBER ANTWERP BELGIUM Ajax on the client All jMaki components built in Jmaki CSS Layouts Dojo Toolkit bundled Multiple versions of a library OK JSON natural data format jMaki XmlHttpProxy support <% library.jmaki.insert({component: “dojo.richtext”, id: “text1”, args: {... }}); %>

DECEMBER ANTWERP BELGIUM Other Libraries In general: all that Java EE supports Templating using FreeMarker Persistence using JPA REST clients JSF/facelets as views Logging, Tango, etc. JPA CRUD generator Intriguing:-) : Dojo on the Server side

DECEMBER ANTWERP BELGIUM JPA sample var em = library.persistence. getEntityManager("jpaExample1-pu"); // Insert some Authors if none are defined var authors = em.createQuery("select a from Author a"). getResultList().toArray(); if (authors.length==0){ var tx = em.getTransaction(); tx.begin(); var author = new Packages.jpaexample.Author(); //equivalent to author.setName("Danny Goodman"); author.name ="Danny Goodman"; author.organisation= "O\'Reilly"; em.persist(author); }

DECEMBER ANTWERP BELGIUM Script engine: Rhino (Mozilla) Robust, fast JavaScript implementation Bytecode compilation Built-in debugging support Great interface to Java code Many language extensions Interface via JSR-223

DECEMBER ANTWERP BELGIUM JavaScript Extensions in Rhino Much more powerful language JavaAdapter JSAdapter  on-the-fly properties Assignable __proto__ property  dynamic inheritance Continuations E4X

DECEMBER ANTWERP BELGIUM E4X sample var sales = ; writer.println( "quantity: == "E4X for ); writer.println( "shopping cart ID is for each( var price in ) { writer.println(" price is: "+ price ); }

DECEMBER ANTWERP BELGIUM JSON Native JSON support Easier to read write Easier to pass back and forth  Clients Server The X in Ajax! (POX versus POJ) jMaki widgets friendly

DECEMBER ANTWERP BELGIUM jRuby Usable via JSR-223 engine Work in progress:  JRuby ↔ JavaScript bridge  Dispatching code to call into a JRuby class Start with simple types, enrich the mapping as we go Goal is to have freedom of choice for what language to use for the application and the libraries

DECEMBER ANTWERP BELGIUM Under the Hood: PhobosAdapter Core Phobos class Handles startup/shutdown, request processing, background tasks Container-independent Framework assumes request/response classes are like the servlet ones Adapter can plug into:  Web container  Grizzly  JDK 6 HTTP server

DECEMBER ANTWERP BELGIUM Supported Deployment Models As a web application War file size with all the libraries: ~8MB Can put all Phobos jars in a shared directory Framework code and resources like jMaki packaged with the application itself

DECEMBER ANTWERP BELGIUM NetBeans Support for Phobos Delivered as NetBeans 5.5, 6.0 plugins via the Update Center Phobos project type  Knows about the logical structure of a Phobos application  Wizards to create controllers, etc.  jMaki palette works for.ejs files too  JPA, Tango support via dependent projects/jars OS JavaScript editor plugin or NB 6.0

DECEMBER ANTWERP BELGIUM Testing and Debugging In-browser testing very time consuming  Speed up development cycle as much as possible Run the app in test mode using a mock container with Grizzly as the HTTP connector Run in the same JVM as NetBeans JavaScript debugger attached to all requests, w/ breakpoints, call stack, etc.

DECEMBER ANTWERP BELGIUM Building, Deploying, Running Build step produces a war file Deployment to the appserver using the existing interfaces Run the app as a regular web application Debugging on deployed app will come later (remote debugging)

DECEMBER ANTWERP BELGIUM Future / Roadmap Other languages, esp. JRuby Debugging deployed applications Use GlassFish v3 when available Simplified access to more EE APIs Seamless scripting/Java debugging Other containers (e.g. JBI) More libraries (e.g. Eventing) Eclipse support (with your help)

DEMO

DECEMBER ANTWERP BELGIUM Summary Phobos: version 0.5 JavaScript on server side: a reality Jmaki integrated Rich client tier and server tier in harmony Already performant Tools developed at the same time

DECEMBER ANTWERP BELGIUM To learn more

Q&A