IBM Research Report. WebRB: A Different Way to Write Web-Applications

Similar documents
Research Report. Developing Highly-Responsive User Interfaces with DHTML and Servlets. Katherine Betz, Avraham Leff, James T.

IBM Research Report. DBC-JS: Middleware for Secure Web-Client Access to Relational Data

IBM Research Report. A Web-Services-Based Deployment Framework in Grid Computing Environment

IBM Research Report. Relational Blocks: Fully Declarative Visual Application Assembly

IBM Research Report. Web-Application Development Using the Model/View/Controller Design Pattern

IBM Research Report. A Negotiation Protocol Framework for WS-Agreement

IBM Research Report. Model-Driven Business Transformation and Semantic Web

IBM Research Report. Breaking Out of Eclipse: Developing an ActiveX Host for SWT

IBM Research Report. Meeting Service Level Agreements In a Commercial Grid

IBM Research Report. Zazen: A Mediating SOA between Ajax Applications and Enterprise Data

COURSE OUTLINE MOC 20480: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

IBM Research Report. Why PBD Systems Fail: Lessons Learned for Usable AI

IBM Research Report. Relational Blocks: Declarative Visual Assembly of Enterprise Applications

Part of this connection identifies how the response can / should be provided to the client code via the use of a callback routine.

IBM Research Report. The Semantic Analysis Workbench (SAW): Towards a Framework for Knowledge Gathering and Synthesis

Creating Custom Dojo Widgets Using WTP

AADL Graphical Editor Design

Teiid Designer User Guide 7.5.0

Full Stack Web Developer

IBM Research Report. Service-Oriented Workflow for Digital Media Broadcasting. Ubiquitous Computing Lab IBM Korea

Web Applications. Software Engineering 2017 Alessio Gambi - Saarland University

IBM Research Report. Inter Mode Selection for H.264/AVC Using Time-Efficient Learning-Theoretic Algorithms

Composer Guide for JavaScript Development

A demo Wakanda solution (containing a project) is provided with each chapter. To run a demo:

Index LICENSED PRODUCT NOT FOR RESALE

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

Varargs Training & Software Development Centre Private Limited, Module: HTML5, CSS3 & JavaScript

The main differences with other open source reporting solutions such as JasperReports or mondrian are:

Tooling for Ajax-Based Development. Craig R. McClanahan Senior Staff Engineer Sun Microsystems, Inc.

IBM Research Report. How to Enable Policy-based Interactions in Dynamic Wireless Networks?

Ajax Enabled Web Application Model with Comet Programming

HTML5 in Action ROB CROWTHER JOE LENNON ASH BLUE GREG WANISH MANNING SHELTER ISLAND

CS WEB TECHNOLOGY

Links Menu (Blogroll) Contents: Links Widget

User Guide. Web Intelligence Rich Client. Business Objects 4.1

BEAWebLogic. Portal. Overview

COURSE 20480B: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Programming in HTML5 with JavaScript and CSS3

20480C: Programming in HTML5 with JavaScript and CSS3. Course Code: 20480C; Duration: 5 days; Instructor-led. JavaScript code.

PHP 6 & The PHP Collaboration Project Present & Future. Zeev Suraski Co-founder & CTO, Zend Technologies Co-architect of PHP

JavaScript: The Definitive Guide

Web 2.0 and AJAX Security. OWASP Montgomery. August 21 st, 2007

Web Architecture Review Sheet

Programming in HTML5 with JavaScript and CSS3

Unveiling Zend Studio 8.0

Eclipse as a Web 2.0 Application Position Paper

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

SSJS Server-Side JavaScript WAF Wakanda Ajax Framework

Wakanda Architecture. Wakanda is made up of three main components: Wakanda Server Wakanda Studio Wakanda Client Framework

Web Design & Dev. Combo. By Alabian Solutions Ltd , 2016

Overview. Principal Product Manager Oracle JDeveloper & Oracle ADF

Frontend guide. Everything you need to know about HTML, CSS, JavaScript and DOM. Dejan V Čančarević

Introduction to Information Systems

Web Development 20480: Programming in HTML5 with JavaScript and CSS3. Upcoming Dates. Course Description. Course Outline

Comprehensive Guide to Evaluating Event Stream Processing Engines

Advanced Dreamweaver CS6

Sections and Articles

Course 20480: Programming in HTML5 with JavaScript and CSS3

eclipse rich ajax platform (rap)

Oracle APEX 18.1 New Features

Fundamentals of Website Development

Software. Full Stack Web Development Intensive, Fall Lecture Topics. Class Sessions. Grading

STARCOUNTER. Technical Overview

Introduction to JavaScript p. 1 JavaScript Myths p. 2 Versions of JavaScript p. 2 Client-Side JavaScript p. 3 JavaScript in Other Contexts p.

Dreamweaver Basics Outline

Lecture 6. Design (3) CENG 412-Human Factors in Engineering May

IBM Research Report. Quantifying the Complexity of IT Service Management Processes

World Wide Web PROGRAMMING THE PEARSON EIGHTH EDITION. University of Colorado at Colorado Springs

Teiid Designer User Guide 7.7.0

the web as it should be Martin Beeby

dotnettips.com 2009 David McCarter 1

Overview

JavaScript CS 4640 Programming Languages for Web Applications

Active Endpoints. ActiveVOS Platform Architecture Active Endpoints

JavaScript & DHTML Cookbool(

Full Stack Web Developer

Networking & The Web. HCID 520 User Interface Software & Technology

Prototyping. Readings: Dix et al: Chapter 5.8 Marc Rettig: Prototyping for tiny fingers, Communications of the ACM, April 1994.

Setting Up a Development Server What Is a WAMP, MAMP, or LAMP? Installing a WAMP on Windows Testing the InstallationAlternative WAMPs Installing a

XPages development practices: developing a common Tree View Cust...

Policy Based Device Access Security Position Paper to Device Access Policy Working Group

UX400. OpenUI5 Development Foundations COURSE OUTLINE. Course Version: 02 Course Duration: 5 Day(s)

A tutorial report for SENG Agent Based Software Engineering. Course Instructor: Dr. Behrouz H. Far. XML Tutorial.

DESIGN AND IMPLEMENTATION OF SAGE DISPLAY CONTROLLER PROJECT

Modern and Responsive Mobile-enabled Web Applications

Basic Steps for Creating an Application with the ArcGIS Server API for JavaScript

Leveraging the Social Web for Situational Application Development and Business Mashups

PHP / MYSQL DURATION: 2 MONTHS

We aren t getting enough orders on our Web site, storms the CEO.

ver Wfl Adobe lif Sams Teach Yourself Betsy Bruce Robyn Ness SAMS 800 East 96th Street, Indianapolis, Indiana, USA WlM John Ray ^lg^

Implementing a Numerical Data Access Service

1 Introduction. 2 Web Architecture

CS 2110 Fall Instructions. 1 Installing the code. Homework 4 Paint Program. 0.1 Grading, Partners, Academic Integrity, Help


A Closer Look at XPages in IBM Lotus Domino Designer 8.5 Ray Chan Advisory I/T Specialist Lotus, IBM Software Group

A Domain-Customizable SVG-Based Graph Editor for Software Visualizations

Adobe Dreamweaver CS6 Digital Classroom

Comp 426 Midterm Fall 2013

Introduction to creating mashups using IBM Mashup Center

Transcription:

RC24091 (W0610-156) October 27, 2006 Computer Science IBM Research Report WebRB: A Different Way to Write Web-Applications Avraham Leff, James T. Rayfield IBM Research Division Thomas J. Watson Research Center P.O. Box 704 Yorktown Heights, NY 10598 Research Division Almaden - Austin - Beijing - Haifa - India - T. J. Watson - Tokyo - Zurich LIMITED DISTRIBUTION NOTICE: This report has been submitted for publication outside of IBM and will probably be copyrighted if accepted for publication. It has been issued as a Research Report for early dissemination of its contents. In view of the transfer of copyright to the outside publisher, its distribution outside of IBM prior to publication should be limited to peer communications and specific requests. After outside publication, requests should be filled only by reprints or legally obtained copies of the article (e.g., payment of royalties). Copies may be requested from IBM T. J. Watson Research Center, P. O. Box 218, Yorktown Heights, NY 10598 USA (email: reports@us.ibm.com). Some reports are available on the internet at http://domino.watson.ibm.com/library/cyberdig.nsf/home.

1 WebRB: A Different Way To Write Web-Applications Avraham Leff James T. Rayfield Abstract Relational Blocks (RBLOCKS) is a visual language that enables developers to assemble enterprise applications without adding imperative code. WebRB is an implementation of RBLOCKS for a web-application environment. Its visual editor runs in a standard browser, and its assembled applications execute, as well, in a standard browser. The WebRB server is responsible for storing applications and their data on behalf of clients, and instantiating them as they are needed in client browsers. The server instantiates an application by creating the web pages that run in the client browser and by providing the required inter-page navigation and associated data-flows. Index Terms relational blocks, web relational blocks, programming web applications, visual programming languages, declarative programming, relational algebra, relational model, software as a service I. INTRODUCTION Relational Blocks (RBLOCKS) [1] is a visual language that allows developers to assemble enterprise applications without adding any imperative code. WebRB is a client/server implementation of RBLOCKS for web-applications in which the WebRB server provides the following services to standard web browser clients: The server provides a visual editor that allows developers to assemble web-applications in a standard browser. Each web page is constructed by dragging & dropping prototype widget, algebra, and model blocks from a palette, and wiring them together. Developers use the editor to specify inter-page navigation and data flows. The server persistently stores a developer s WebRB page designs for later use. The server validates WebRB page designs and reports errors to the visual editor. The server instantiates the WebRB application as a web-application that executes in a standard browser. Typically, applications that require much user interaction such as program editors reside on the client. The assumption is that having them reside on the server will result in unacceptable application latency. WebRB shows that a powerful visual editor can reside on the server and still provide a good user experience. We therefore prefer to use the Software as a Service model (SaaS [2]) so that WebRB is deployed, managed, and updated to servers rather than to end-user computers. Having our application reside on a server makes maintenance much simpler, since bug-fixes and improvements are installed only on the server, and are immediately available to all clients. Another advantage is that collaboration between multiple developers is facilitated since the server page-designs can be shared. Because the WebRB editor runs in a standard browser, it is especially suited to benefit from some of the advantages of the SaaS model. First, no installation is required, in contrast to rich editors such as those based on GEF [3] and Eclipse [4]. People prefer not to have to install yet-another-application which might break their computer, be incompatible with existing applications, or require patches. Second, browsers are so ubiquitous that it s IBM T.J. Watson Research Center email: avraham@ibm.com IBM T.J. Watson Research Center email: jtray@ibm.com

Leff & Rayfield: WebRB 2 Fig. 1. Blocks and Wires hard to find yourself using a computer without a browser anymore. Users can access the WebRB service on their home computer, or even when using somebody else s computer. WebRB thus exhibits three interesting features. First, as an implementation of RBLOCKS, developer productivity can increase because of the language features discussed in [1]. Second, the visual editor s feature-set and responsiveness resemble rich client behavior (e.g., those developed using the Graphical Editing Framework [3]) even though it executes in a standard browser. Third, WebRB applications are deployed as standard web-applications, that execute in a standard browser, without developers adding any client-side or server-side imperative code. We discuss these features in this paper. After a summary of the RBLOCKS visual language, we discuss the visual editor in Section II, and the runtime environment in Section III. We offer some conclusions about WebRB s use of web browsers in Section IV. A. Relational Blocks Language RBLOCKS is a visual language whose programs consist of blocks (of various types) that are interconnected to form a relational circuit. The circuit is relational because the language uses only the relation data-type, and because data transformations are described using relational algebra. (See [5], which provides a good introduction to a type system based on the relational model.) Figure 1 shows three blocks (two text widgets and a JOIN block) connected so that the JOIN block s output is a relation consisting of a two-attribute tuple. (We prefer to avoid the persistent database connotations associated with SQL terminology: e.g., we refer to attributes, rather than columns). Each of the text widgets have an output pin ( outputvalue ); the JOIN block has two input pins ( input0 and input1 ), and one output pin ( output ). An input pin implies that the block can receive relation-valued input from other blocks. An output pin implies that the block can transmit relation-valued output to other blocks. Wires specify relational data-flow between two blocks by connecting input pins to output pins. All primitive blocks fall into one of three categories: model, widgets, and algebra. These correspond, respectively, to the well-known Model/View/Controller paradigm. Model blocks are used to access and update the state of the application. Model-block updates occur when a GUI event occurs; for example, when a user clicks on a submit button. Broadly speaking, model blocks may be backed by either persistent or transient storage; this is an application design issue and the RBLOCKS model API is the same for both. A model block s output is the current state of the relation; its input is the desired next state of the relation. In contrast, Algebra blocks in principle will update their outputs whenever their input value(s) change (although they are not necessarily implemented this way). Thus, a Join block s output is always the relational join of it s two inputs. Algebra blocks are used to declaratively specify an application s controller logic. RBLOCKS uses a formulation of the relational algebra based on Relational A ([5], Appendix A). Relational algebra is in many ways a perfect match for a relational model because it provides a declarative description of (1) what data should be extracted from the model and (2) how that data should be manipulated [6]. Also, relational algebra operations are reasonably simple in isolation, small in number, and can

Leff & Rayfield: WebRB 3 be easily composed to form more complex operations. Widget-block outputs are always based on the current contents of the widget; e.g. a text-input widget always provides its current contents on its output pin. However, non-interactive widgets (e.g. text, tables) are only updated when a GUI event occurs. Widget blocks are rendered at runtime as an HTML GUI widget, but also implement the relational API. Program-writeable widgets have relation inputs (e.g., a single-tuple input to a label block with text and font attributes). Program-readable widgets have relation outputs (e.g., a single-tuple output from a slider block containing a value attribute). More complicated widgets such as tables and lists are multi-tuple relations. Because all blocks have the same visual representation and semantics, RBLOCKS does not place any constraints on which blocks can talk to other blocks. For example, an algebra block s inputs can include the current state of model blocks or the current values of the readable widgets. Similarly, an algebra block s output can be wired to a model block or to a writeable widget block. A developer assembles instances of RBLOCKS primitive blocks to produce pages with higher-level function. Such pages can be embedded in another page in a hierarchical approach to application construction. Pages have exactly the same relational API and visual representation as primitive blocks. II. WEBRB EDITOR The WebRB editor runs in a standard Mozilla Firefox browser and is used to visually construct RBLOCKS programs. Because RBLOCKS is a visual language, there is a good fit between the editor and the programs that it constructs. Readers who wish to experience WebRB live can currently access it as a free alpha- Works service [7]. Figure 2 shows that the WebRB editor is comprised of several frames. We focus here on the palette (which contains the set of available primitive blocks); the page editor (used to edit a single web-page); and the property editor (used to customize a primitive block instance). As discussed in Section I, the WebRB editor is a service in the sense that no code is down-loaded and installed on a developer s computer. Instead, a developer s WebRB page designs are stored on a server, and loaded into the developer s browser as needed. Once we decided that the WebRB editor should be a service, we faced the challenge of making it responsive and feature-rich despite the fact that no software is installed on the developer s computer. For example, developers can drag and drop blocks from the palette to precise positions on the page editor. At runtime, corresponding GUI widgets are rendered at precisely those positions on the web-page. This is much easier than using imperative code to draw and position the widgets. A wire is drawn by left-clicking near an given pin, dragging the mouse to the other pin while holding the left mouse-button down, and then releasing the mouse button. Wires can be deleted by clicking (to select the wire) and hitting the delete key; blocks (and all of their wires) are deleted by clicking (to select the block) and hitting the delete key. Also, whenever a developer selects a block, a block-specific editor is loaded into the property editor frame, and populated with that block s state so it can be customized. We solved this challenge by structuring the life-cycle of a page-design so that the browser communicates infrequently with the server. Communication is required for page life-cycle operations (create, load, save, and delete a page design), page validation, and for some property-editor functions (such as loading pageand table-selector widgets). Otherwise, we use AJAX [8] technologies such as DHTML, JavaScript, and XmlHttpRequest to enable the editor to manipulate a page-design entirely within the browser. Every primitive block is implemented as a JavaScript class in which the block itself is drawn with HTML. Wires are drawn using SVG [9], since HTML does not have enough functionality to draw diagonal lines. Wires are made easily selectable by using SVG to trace a transparent outline that is much thicker than the visible outline itself. Once a block is selected, we use a combination of CSS absolute positioning and mouse events to implement dragging. A block s JavaScript code uses the DOM events API to track

Leff & Rayfield: WebRB 4 Fig. 2. The WebRB Editor events such as mouseup and mousemove to determine where a block has been dragged to. Methods such as Firefox s getcomputedstyle return the computed CSS for rendered HTML. We can thus calculate a block s height and width, and determine where to draw pins and selection outlines. Page-design communication between the WebRB editor and the server (e.g., a save or load operation), is implemented with a framework based on XML DOM trees [10]. Each block type has a getstate() method that returns a DOM tree that contains all state (e.g., screen position and property settings) needed to subsequently hydrate the block (via its JavaScript constructor method). Wires also have a getstate() method that returns a DOM tree indicating the endpoints (block and pin). We use the Mozilla browser s XMLSerializer API to serialize an entire page-design as an XML document that contains the state of all the page s DOM trees. Finally, we invoke the XmlHttpRequest API to transmit the XML document to the server, where it is persistently stored in a database table. Loading a page-design from the server into the WebRB editor is the mirror image of this process. III. WEBRB RUNTIME The WebRB runtime is responsible for deploying the page-designs discussed in Section II as webapplications that execute in a standard browser. We explain in this Section how our runtime can do this without developers adding any code on either the client or the server. We also explain how individual page-designs are assembled as a web-application.

Leff & Rayfield: WebRB 5 Fig. 3. Example: an ecommerce Details WebRB Page Design The server does not have to directly manipulate the RBLOCKS visual language because page-designs are stored in their serialized XML representation. The XML representation serves as a canonical form of a given block: it s instantiated as an PHP object on the server, and as a JavaScript object in the browser. The WebRB runtime renders a WebRB page by creating server-side versions of each RBLOCKS block. Model blocks are implemented as a wrapping of connections to database tables; algebra blocks are implemented to provide the required algebra function; and widget blocks are implemented so that their gethtml() method produces the corresponding HTML that can be rendered in a web-browser. Block inter-connection is implemented by driving the specified data-flow from output pins to their input pins, and so on, using a recursive process. The initial page of an application is displayed when the client s browser issues an HTTP GET request: the server s WebRB runtime calls gethtml() to create the initial page, and returns the web-page to the browser. During initial-page evaluation, widgets with output pins will return empty strings. Once launched, the server forgets about the page until the user interacts with the web-page, causing an HTTP POST of the page and its data to the server. The WebRB runtime uses the POST data to instantiate the corresponding server-side version of that web-page, supplies the user-supplied data (e.g., text-field input) to the widget blocks, and evaluates the resulting relational circuit. The runtime must then determine which web-page should be instantiated next. Consider, for example, Figure 3 which is a screen-shot of a Details page-design from an ecommerce web-application. (This is taken from the ecommerce example that can be imported by users of the WebRB alphaworks service [7].) This page gives details about a specific product (NAME, DESCRIPTION, and PRICE). It also shows how developers use page-transition blocks (upper-right) to specify what web-page should be instantiated after a user interacts with the product details page. The Home and Show Cart navigation buttons are wired to the corresponding ecommerce pages: only the button that the user clicked will produce the TRUE relation output thus enabling the page transition the other button will produce a FALSE output. In general, exactly one page-transition block must be enabled for any given evaluation of a page-design. Anything else signifies a logical error in the design, and is detected and reported by the runtime.

Leff & Rayfield: WebRB 6 One final step is done by the WebRB runtime before instantiating the application s next web-page. Note the use of a page input block in the lower-left of Figure 3. The developer has specified that a product name input must be provided before this page can be instantiated. (The value of this input is JOIN d with the product information database table to create the HTML labels that display the product details.) Any page-design that specifies a transition to this Details page (via a page-transition block) will have to also include a wire to the corresponding input pin of the Details page. Figure 4 shows how this works in practice. The Figure shows screen-shots of two instantiated web-pages. The first is a Search Results page that lets a user type a product query string. In this screen-shot, the user previously queried for staplers, and the ecommerce application returned a populated web-page that allows the user to drill-down to get more details about the product. The second screen-shot shows the web-page that the WebRB runtime returns when the user clicks on the details button. The details button in the Search Results page-design is wired to the enable pin of the Details page-transition block. In addition, the table widget block feeds the value of that row s NAME attribute to the product name input pin of the Details page-transition block. Therefore, after evaluating the HTTP POST of the Search Results page (and determining that the Details page is to be instantiated next), the WebRB runtime flows the NAME value into the Details page as it is instantiated. The result is shown in the second screen-shot of Figure 4. IV. CONCLUSION WebRB is a different way to write web-applications. Rather than using a mix of imperative code (e.g., PHP and JavaScript) on both the client and server, a single visual language is used which requires no additional code from the developer. The WebRB visual editor runs in a standard browser, and WebRB applications execute as web-applications that run in a standard browser. We note in closing, that although browsers provide a more restricted user-interaction model than socalled rich client editors, this is in some ways a benefit. Developers already understand how to interact with a browser, and therefore already (mostly) know how to use WebRB. Also, because WebRB applications are themselves browser-based, we can immediately show the developer the results of any changes. There is a one-to-one correspondence between a design-page and a web-page: when a developers edits a WebRB page, she can immediately see the effects of that change in the visual editor, and also execute the page immediately if desired. We focused in this paper on the way that WebRB is implemented as a software service in which the server loads the visual editor into a user s web browser, and page designs and application state are stored on the server. The software service model has well-known advantages, but required us to make the editor responsive and feature-rich while executing in a standard browser. We also explained how applications written in the WebRB visual language are translated in a straight-forward way to execute as a web-applications. Readers can experience WebRB as a live service [7]. REFERENCES [1] Avraham Leff and James T. Rayfield. Relational blocks: Declarative visual assembly of enterprise applications. http://domino.research.ibm.com/library/cyberdig.nsf/, 2006. RC24014. [2] David Greschler and Tim Mangan. Networking Lessons in Delivering Software as a Service - Part I. International Journal of Network Management, 12(5):317 321, September/October 2002. [3] Graphical Editing Framework. http://www.eclipse.org/gef, 2006. [4] Eclipse Project. http://www.eclipse.org/eclipse, 2006. [5] C.J. Date and H. Darwen. Databases, Types and the Relational Model (3rd Edition). Addison-Wesley, Boston, MA, 2006.

Leff & Rayfield: WebRB 7 Fig. 4. WebRB Pages Executing In the Browser [6] E. F. Codd. A relational model of data for large shared data banks. Communications of the ACM, 13(6):377 387, 1970. [7] alphaworks Services: Web Relational Blocks. http://services.alphaworks.ibm.com/webrb/, 2006. [8] Justin Gehtland, Dion Almaer, and Ben Galbraith. Pragmatic Ajax: A Web 2.0 Primer. Pragmatic Bookshelf, 2006. [9] Scalable Vector Graphics (SVG) 1.1 Specification. www.w3.org/tr/svg/, 2006. [10] Document object model (DOM). http://www.w3.org/tr/dom-level-2-core/, 2006.