SlideShare a Scribd company logo
What’s new in DWR v3


Joe Walker
DWR Lead Developer
SitePen UK
Recap
                                                  Since we last talked ...
                                                    Named Parameters
                                                        Binary Files
                                                JavaScript Extending Java
                                                    Better Reverse Ajax
                                               Data Sync: Dojo Data Store
                                               JSON / JSONP / JSON-RPC
                                            Varargs and Overloaded Methods
                                                        What’s Next


© SitePen, Inc. 2008. All Rights Reserved
Recap



© SitePen, Inc. 2008. All Rights Reserved
© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

Database storage engines
Database storage enginesDatabase storage engines
Database storage engines

A storage engine is a software module that a database management system uses to create, read, update and delete data from a database. MySQL supports several storage engines that act as handlers for different table types. Storage engines are categorized as transactional or non-transactional. Transactional tables can auto-recover from failures while non-transactional tables cannot. Common storage engines include MyISAM, InnoDB, MEMORY, ARCHIVE, BLACKHOLE, and CSV. Each engine has different features for speed, storage limits, transactions, and other factors. The appropriate engine depends on the specific database needs and requirements.

databasestorageengines
SQL2.pptx
SQL2.pptxSQL2.pptx
SQL2.pptx

Jdbshehdhdhdjssksndkdbdhrbsjsjdbhddbhxbdjdjsisdjdjdndjdjndjsdjdhbdhddhdh dbdjdbhddhdhdbdjdbhdhdjdjdjdjdjdhdhdhbdhdbrhdhdhdbdhdhdhdhdhdhhdhdhdhdhdhdhdhdhdhdhdhdbdbdhdhdhdhdhdhdhdhdhh

#cs#sql#boring
3 - Integrity Constraints.pdf
3 - Integrity Constraints.pdf3 - Integrity Constraints.pdf
3 - Integrity Constraints.pdf

Integrity constraints are a set of rules used to maintain data quality and ensure data is not accidentally damaged during insertion, updating or other processes. There are several types of integrity constraints including domain constraints which define valid value sets for attributes, entity integrity constraints which require primary keys cannot be null, and referential integrity constraints which require foreign keys match primary keys in other tables. Key constraints uniquely identify entities and an entity set can have multiple keys but only one is designated the primary key.

Marshalling Types

        Primitive types, and their Object counterparts
                 int, boolean, long, float, double, etc
        Obvious classes
                 String, Date, BigDecimal, BigInteger, Enum, etc
        Arrays and Collections
                 Map, List, Set, Iterator, ...
        JavaBeans and Objects
        XML objects
                 DOM, XOM, JDom, Dom4J


© SitePen, Inc. 2008. All Rights Reserved
© SitePen, Inc. 2008. All Rights Reserved
Since we last talked ...



        TIBCO General Interface
        SitePen
        http://svn.directwebremoting.org




© SitePen, Inc. 2008. All Rights Reserved
Named Parameters



© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

Introduction to SQL Server Security
Introduction to SQL Server SecurityIntroduction to SQL Server Security
Introduction to SQL Server Security

This document discusses securing Microsoft SQL Server. It covers securing the SQL Server installation, controlling access to the server and databases, and validating security. Key points include using least privilege for service accounts, controlling access through logins, roles and permissions, auditing with SQL Server Audit and Policy Based Management, and services available from Pragmatic Works related to SQL Server security, training and products.

ORACLE PL SQL
ORACLE PL SQLORACLE PL SQL
ORACLE PL SQL

This document provides a summary of Oracle 9i and related database concepts. It covers relational database management systems (RDBMS) and what they are used for. It also discusses Oracle built-in data types, SQL and its uses, normalization, indexes, functions, grouping data, and other database objects like views and sequences. The document is intended as a presentation on key aspects of working with Oracle 9i databases.

oracle plsql
Displaying data from multiple tables
Displaying data from multiple tablesDisplaying data from multiple tables
Displaying data from multiple tables

The document discusses different types of joins in SQL for combining data from multiple tables, including inner joins, outer joins, natural joins, joins using the USING clause, and self-joins using the ON clause. It provides examples of SQL queries for left, right, full, and cross joins. Cross joins produce the cartesian product of all rows in two tables, while inner and outer joins match rows based on join conditions.

multipledatadisplaying
Named Parameters



        DWR will create client-side classes to look like
        server-side classes to make passing parameters
        easy




© SitePen, Inc. 2008. All Rights Reserved
Named Parameters

          Java:

          public interface Person { ... }
          public class Employee implements Person { ... }
          public class Manager extends Employee { ... }

          public HumanResources {
            public void addPerson(Person p) { ... }
          }

          JavaScript:

          Manager m = new Manager();
          HumanResources.addPerson(m);




© SitePen, Inc. 2008. All Rights Reserved
Named Parameters



        Why?
                 • Inheritance is useful in places
                 • It saves creating addEmployee() and addManager()
                   methods




© SitePen, Inc. 2008. All Rights Reserved
Lightweight Named
                                      Parameters



© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

INTRODUCTION TO DATABASE
INTRODUCTION TO DATABASEINTRODUCTION TO DATABASE
INTRODUCTION TO DATABASE

This document discusses database concepts and architecture. It covers data models including conceptual, physical and implementation models. It discusses the history of relational, network and hierarchical data models. It also covers the three-level database architecture including the external, conceptual and internal schemas. The architecture supports logical and physical data independence. The document discusses database languages like DDL and DML and different database interfaces and systems.

Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material

SQL is a standard language used to manage data in relational database management systems. It can be used to create and modify database objects like tables and stored procedures, query and manipulate data, and set permissions. Common SQL statements include SELECT to query data, INSERT and UPDATE to modify data, CREATE and ALTER to define database structure, and DELETE to remove data. Transactions are managed using commands like COMMIT, ROLLBACK, and SAVEPOINT. Security is enforced using GRANT and REVOKE commands to manage user permissions on database objects.

History of database processing module 1 (2)
History of database processing module 1 (2)History of database processing module 1 (2)
History of database processing module 1 (2)

The document discusses the history and evolution of database management systems from the 1960s to present. It covers early stages like organizational databases in the 1960s, the introduction of the relational model in the 1970s, object-oriented databases in the 1980s, client-server applications in the 1990s, and internet-based databases in the 2000s. It also describes some common database components, models, and relationships.

Lightweight Named Parameters




        DWR also allows a lighter-weight method of
        declaring types




© SitePen, Inc. 2008. All Rights Reserved
Lightweight Named Parameters

          Java:

          public interface Person { ... }
          public class Employee implements Person { ... }
          public class Manager extends Employee { ... }

          public HumanResources {
            public void addPerson(Person p) { ... }
          }

          JavaScript:

          var m = { $dwrClassName:'Manager', firstname:'Joe', ...};
          HumanResources.addPerson(m);




© SitePen, Inc. 2008. All Rights Reserved
Lightweight Named Parameters



        Why?
                 • Everything as for Named Parameters
                 • But sometimes you get an object from somewhere
                   else




© SitePen, Inc. 2008. All Rights Reserved
Binary Files: File Upload



© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

EDB Failover Manager - Features and Demo
EDB Failover Manager - Features and DemoEDB Failover Manager - Features and Demo
EDB Failover Manager - Features and Demo

EnterpriseDB (EDB) delivers an open source database platform for new applications, cloud migration, modernization, and legacy migration. EDB Failover Manager 3.6 provides high availability and failover capabilities for PostgreSQL databases. It supports various Linux distributions and has prerequisites of Java, streaming replication, firewall configuration. The architecture includes a master, standby, witness, agent, VIP, and JGroups. New features and tunable properties are discussed for user requirements and different failover scenarios.

 
by EDB
postgresqldatabases
Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a Database

Normalization is a process that organizes data to minimize redundancy and dependency. It divides tables to relate data without duplicating information. There are three common normal forms. The first normal form structures data into tables without repeating groups. The second normal form removes attributes not dependent on the primary key. The third normal form removes transitive dependencies so each non-key attribute depends directly on the primary key. Examples show how data can be normalized through multiple forms to eliminate anomalies and inconsistencies.

"normalizations in a database""database""normalization"
Intro to dbms
Intro to dbmsIntro to dbms
Intro to dbms

The document provides an introduction to database management systems (DBMS) presented by Mrs. Surkhab Shelly. It defines a database and DBMS, lists some examples of DBMS software, and discusses the advantages of using a DBMS including reducing data redundancy, sharing data, ensuring data integrity and security, and automating backup and recovery. It also outlines the components of a DBMS including software, hardware, procedures, data, and different types of users.

integrityconsistencyaccuracy
Binary Files: File Upload


        DWR has always had a long list of things that it will
        marshall including Dates, DOM trees, etc


        In addition, DWR will now marshall binary files just
        as if they were the text resources it handles now




© SitePen, Inc. 2008. All Rights Reserved
Binary Files: File Upload

          Java:

          public Remoted {
            public void receiveBinaryFile(byte[] uploaded) { ... }
          }

          HTML:

          <input id='fileId' type='file'/>

          JavaScript:

          var binary = dwr.util.getValue('fileId');
          Remoted.receiveBinaryFile(binary);




© SitePen, Inc. 2008. All Rights Reserved
Binary Files: File Upload

        Will marshall to:
                 • byte[]
                 • java.awt.BufferedImage
                 • java.io.InputStream
                 • org.directwebremoting.io.FileTransfer
                   (gives access to filename and mime-type in
                   addition to the contents)




© SitePen, Inc. 2008. All Rights Reserved
Binary Files: File Upload


        Why?
                 • This is a lot easier than using commons-fileupload
                   or similar
                 • We can provide integration with progress bar
                   widgets




© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

Data structure mind mapping
Data structure mind mapping Data structure mind mapping
Data structure mind mapping

A Mind mapping (Eagle eye ) that shows the characteristics of Data structure & why it's needed and it's basic terminology ,

data structureterminlogyusage
Exercícios - Tutorial ETL com Pentaho Data Integration
Exercícios - Tutorial ETL com Pentaho Data IntegrationExercícios - Tutorial ETL com Pentaho Data Integration
Exercícios - Tutorial ETL com Pentaho Data Integration

1. O documento descreve como criar uma transformação no Pentaho Data Integration (PDI) para gerar a mensagem "Hello World" utilizando dois steps: um para gerar linhas e outro vazio. 2. Também mostra como expandir essa transformação para ler dados de um arquivo texto, adicionar campos constantes, gerar sequências e gravar o resultado em um novo arquivo texto. 3. Por fim, explica como criar uma conexão com um banco de dados Apache Derby para armazenar dados no futuro.

data warehousingpentahoetl
Partitioning
PartitioningPartitioning
Partitioning

Partitioning allows tables and indexes to be subdivided into smaller pieces called partitions. Tables can be partitioned using a partition key which determines which partition each row belongs to. Partitioning provides benefits like improved query performance for large tables, easier management of historical data, and increased high availability. Some disadvantages include additional licensing costs, storage space usage, and administrative overhead to manage partitions. Common partitioning strategies include range, list, hash and interval which divide tables in different ways based on column values.

partitioning
Binary Files: Download



© SitePen, Inc. 2008. All Rights Reserved
Binary Files: Download


        Binary file handling is 2 way. It’s good for:
                 • Images
                 • PDF files
                 • Word, Excel documents
                 • etc.




© SitePen, Inc. 2008. All Rights Reserved
Binary Files: Download

          Java:
          public Remoted {
            public void getPDF(String contents) {
                        ByteArrayOutputStream buf = new ByteArrayOutputStream();
                        Document doc = new Document();
                        PdfWriter.getInstance(doc, buf);
                        doc.open();
                        doc.add(new Paragraph(contents));
                        doc.close();
                        return new FileTransfer(quot;ex.pdfquot;, quot;application/pdfquot;, buf.toByteArray());
          }

          JavaScript:
          Remoted.getPDF('Joe', function(data) {
            dwr.engine.openInDownload(data);
          });




© SitePen, Inc. 2008. All Rights Reserved
Binary Files: Download



        Why?
                 • This is a lot easier than creating a special PDF/
                   image/etc serving servlet




© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)
今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)
今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)

今日から始める XPages アプリケーション開発

notes domino xpages
introduction to database
 introduction to database introduction to database
introduction to database

This document provides an introduction to databases including: - It defines what a database is and how data is organized into tables with rows and columns. - It discusses some common database management systems like Microsoft Access, MySQL, and SQL Server. - It outlines some key components of a database management system environment including hardware, software, data, procedures, and people. - It also briefly mentions some potential disadvantages of database management systems like complexity, size, costs, and performance issues.

SBML: What Is It About?
SBML: What Is It About?SBML: What Is It About?
SBML: What Is It About?

SBML (Systems Biology Markup Language) is a format for representing computational models of biological processes. It defines data structures and serialization to XML for representing models in a neutral, machine-readable way. Development of SBML started in 2000 with the goal of facilitating exchange of models between software tools and databases. SBML provides syntax but limited semantics, so standard annotation schemes have been developed to link models to external data resources and provide additional meaning. The scope of SBML encompasses many types of biological models and is expanding through new packages to support additional model types.

sbmlsystems biologysemantic web
Javascript extending Java



© SitePen, Inc. 2008. All Rights Reserved
Javascript extending Java




        DWR will allow you to implement Java interfaces
        using JavaScript




© SitePen, Inc. 2008. All Rights Reserved
Javascript extending Java
           Java:
          public interface BazListener {
            void somethingChanged(String msg);
          }
          public class Remote {
            public void addBazListener(BazListener bl) { ... }

                public void calledLater() {
                  for (BazListener bl : listeners)
                    bl.somethingChanged(quot;JS objects can implement Java interfacesquot;);
                }
                ...
          }

          JavaScript:
          function BazListener() {this.$dwrByRef;}
          BazListener.prototype.somethingChanged = function(msg){alert(msg);};

          var bl = new BazListener();
          Remote.addBazListener(bl);




© SitePen, Inc. 2008. All Rights Reserved
Javascript extending Java



        Why?
                 • Intuitive way to interact
                 • Easy Pub-sub
                 • Allows interaction with existing APIs




© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

Lenovo's 'Idea Tweetathon' Contest Guidelines
Lenovo's 'Idea Tweetathon' Contest GuidelinesLenovo's 'Idea Tweetathon' Contest Guidelines
Lenovo's 'Idea Tweetathon' Contest Guidelines

Detailed guidelines for the Lenovo Intel ' It's a Mod Mod World' Contest on Twitter to be held from 16th March-24th March 2011

lenovo intel whats your idea of fun twitter conteslenovo intel whats your idea of fun twitter contes
Cross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORSCross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORS

Using CORS (cross origin resource sharing) you can easily and securely to cross site scripting in webapps - less servers and more integration from apis right in the browser This was presented during Web Directions South, 2013, Sydney, Australia.

javascript cors web
The Role of Standards in BPM
The Role of Standards in BPMThe Role of Standards in BPM
The Role of Standards in BPM

The document discusses process standards for business process modeling and management. It describes the risks and benefits of standards, prominent standards for graphical notation (BPMN), interchange formats (XPDL, BPDM), and execution (BPEL). It predicts that BPMN will remain the primary modeling notation, BPDM may replace XPDL as the interchange standard, and standards will continue evolving to improve integration of business and IT.

Scalable Reverse Ajax



© SitePen, Inc. 2008. All Rights Reserved
Scalable Reverse Ajax



        Previously there were some scalability limitations
        with the 2.0 reverse ajax API.
        3.0 deprecates the problem areas.




© SitePen, Inc. 2008. All Rights Reserved
Scalable Reverse Ajax


        Reverse Ajax proxies no longer take a list of
        ScriptSessions in the constructor, they just write to
        the current ‘destination’


        The Browser API allows you to change the current
        ‘destination’




© SitePen, Inc. 2008. All Rights Reserved
Scalable Reverse Ajax


          // The default destination is the browser
          // that caused the current action to happen.
          Window.alert(quot;Helloquot;);

          // Non DWR thread have no default destination
          Thread t = new Thread(new Runnable()) {
            public void run() {
              // Error
              Window.alert(quot;Helloquot;);
            }
          });




© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

Specialist in personal injury law
Specialist in personal injury lawSpecialist in personal injury law
Specialist in personal injury law

This document discusses the role and importance of personal injury lawyers. It explains that a personal injury lawyer can help victims of accidents file lawsuits against those responsible for their injuries. They specialize in assisting clients who have been injured due to someone else's negligence and are necessary to handle personal injury claims. Contact information is provided for Paramount Lawyers, a firm that handles personal injury cases.

specialist in personal injury lawcompensation claim qldcompensation claim sydney
The Most Misunderstood “Buzzword” of All Time: Content Marketing
The Most Misunderstood “Buzzword” of All Time: Content MarketingThe Most Misunderstood “Buzzword” of All Time: Content Marketing
The Most Misunderstood “Buzzword” of All Time: Content Marketing

We break down what is wrong with Content Marketing and how to fix it. Don’t repeat the same mistakes Interruption Marketing made. Adopt a Consumer First Marketing approach to dramatically change your Content Marketing results for the better.

content strategymarketingdigital marketing
Halkin Dusmanlari
Halkin DusmanlariHalkin Dusmanlari
Halkin Dusmanlari
Scalable Reverse Ajax

          // Set the destination to be all browsers that
          // are looking at the current page
          Browser.withCurrentPage(new Runnable()) {
            public void run() {
              Window.alert(quot;Helloquot;);
            }
          });

          // Set the destination to be all browsers that
          // are looking at the current page
          Browser.withCurrentPage(quot;index.htmlquot;, new Runnable()) {
            public void run() {
              Window.alert(quot;Helloquot;);
            }
          });



© SitePen, Inc. 2008. All Rights Reserved
Scalable Reverse Ajax



          // Broadcast to everyone
          Browser.withAllSessions(...);

          // Broadcast to subsets
          Browser.with*Filtered(scriptSesssionFilter, ...);

          // To a known individual
          Browser.withSession(sessionId, ...);




© SitePen, Inc. 2008. All Rights Reserved
Scalable Reverse Ajax



        Why?
                 • It’s generally easier to use
                 • It decouples generation from routing
                 • It scales




© SitePen, Inc. 2008. All Rights Reserved
Reverse Ajax APIs



© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

Streamlining the Quota Process for a World-Class Sales Organization
Streamlining the Quota Process for a World-Class Sales OrganizationStreamlining the Quota Process for a World-Class Sales Organization
Streamlining the Quota Process for a World-Class Sales Organization

Jim Parker discusses streamlining Novell's quota setting process. Novell is a global infrastructure software company with $1 billion in annual revenue. Previously, Novell's quota setting process was inefficient, inflexible, and inconsistent, involving 50 people over 4-5 months. Novell implemented a new centralized process using the TrueQuota software system. This standardized the methodology, provided automated linkages between quotas, and reduced the Americas process to under a week. The new process and system improved accuracy, flexibility, and management visibility into quotas.

Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)
Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)
Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)
Callidus Software Product Suite Overview: What's New
Callidus Software Product Suite Overview: What's NewCallidus Software Product Suite Overview: What's New
Callidus Software Product Suite Overview: What's New

presented at the TrueConnection 2008 Sales Performance Management Conference, hosted by Callidus Software

optimizationincentivecompensation
Reverse Ajax APIs



                                            Reverse Ajax != Comet


                   Reverse Ajax == Comet + Polling + Piggyback




© SitePen, Inc. 2008. All Rights Reserved
Reverse Ajax APIs: JS Level



          // Low level: Use server-side W3C DOM methods
          Element ele = doc.createElement(quot;pquot;);

          ScriptSessions.addFunctionCall(
                       quot;document.body.appendChildquot;,
                       ele);




© SitePen, Inc. 2008. All Rights Reserved
Reverse Ajax APIs: JS Level




          // Low level: Any arbitrary JavaScript
          String s = quot;if (document.all) window.alert('IE');quot;;

          ScriptSessions.addScript(s);




© SitePen, Inc. 2008. All Rights Reserved
Reverse Ajax APIs: DOM Level



          // Some methods from Window and Document
          import javax.servlet.http.Cookie;
          import org.directwebremoting.ui.browser.Document;

          Cookie c = new Cookie(quot;namequot;, quot;valuequot;);
          Document.setCookie(c);




© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

Agencies Blogging
Agencies BloggingAgencies Blogging
Agencies Blogging

A quick look at some advertising agencies that blog as you start to answer the question: Should we be blogging?

APMP Knowledge Sharing Tools 11 Oct07
APMP  Knowledge Sharing Tools 11 Oct07APMP  Knowledge Sharing Tools 11 Oct07
APMP Knowledge Sharing Tools 11 Oct07

(1) Current knowledge sharing tools have evolved from traditional top-down Web 1.0 sites to more collaborative Web 2.0 sites where information is shared bidirectionally and content is continually updated by users. (2) Popular collaboration tools include wikis, blogs, social networks, and enterprise platforms like SharePoint that facilitate team communication and knowledge sharing. (3) To solve information problems, organizations should identify information-sharing roles, investigate social software solutions, and encourage hands-on use of collaborative tools.

01 Paolo Lessio, Processo civile telematico
01 Paolo Lessio, Processo civile telematico01 Paolo Lessio, Processo civile telematico
01 Paolo Lessio, Processo civile telematico

Il seminario di Paolo Lessio sul PCT

processociviletelematico
Reverse Ajax APIs: dwr.util



          // dwr.util in Java
          import org.directwebremoting.ui.dwr.Util;

          String[] opts = new String[] {quot;onequot;,quot;twoquot;,...};
          Util.addOptions(quot;liquot;, opts);




© SitePen, Inc. 2008. All Rights Reserved
Reverse Ajax APIs: Scriptaculous




          // Scriptaculous Effects in Java
          import org.directwebremoting.ui.scriptaculous.Effect;

          Effect.fade(quot;someIdquot;);




© SitePen, Inc. 2008. All Rights Reserved
Reverse Ajax APIs: TIBCO GI


          // TIBCO General Interface in Java
          import jsx3.GI;
          import jsx3.app.*;
          import jsx3.gui.*;

          Server server = GI.getServer(quot;servernamequot;);
          TextBox phoneNum = server.getJSXByName(quot;phoneNumquot;,
                                             TextBox.class);

          phoneNum.setValue(quot;servernamequot;);




© SitePen, Inc. 2008. All Rights Reserved
Reverse Ajax APIs: Dojo



          // Dojo in Java
          import org.dojotoolkit.dijit.Dijit;
          import org.dojotoolkit.dijit.Editor;

          Editor e = Dijit.byId(quot;pricequot;, Editor.class);
          e.setValue(42);




© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

02 - Paolo Lessio, Processo civile telematico
02 - Paolo Lessio, Processo civile telematico02 - Paolo Lessio, Processo civile telematico
02 - Paolo Lessio, Processo civile telematico
informaticslegalbicocca
New Media Addicts Anonymous
New Media Addicts AnonymousNew Media Addicts Anonymous
New Media Addicts Anonymous

A short presentation delivered at the Interesting Amsterdam 2008 conference .. about being a new media junkie and what the future beholds.

balievirtualworldstrendscommodoreamigagrandtheftautointamsterdam
Andrea Cavalloni, Digital Rights Management: Il caso Sony-BMG
Andrea Cavalloni, Digital Rights Management:Il caso Sony-BMGAndrea Cavalloni, Digital Rights Management:Il caso Sony-BMG
Andrea Cavalloni, Digital Rights Management: Il caso Sony-BMG
Scalable Reverse Ajax

        Why?
                 • A full range of APIs for dynamically updating client
                   data
                 • DWR doesn’t do widgets, but it does talk to the
                   people that do


        Drapgen can be used to create and maintain large
        APIs




© SitePen, Inc. 2008. All Rights Reserved
Dojo Data Store



© SitePen, Inc. 2008. All Rights Reserved
Dojo Data Store




        DWR now implements all 4 interfaces to allow Dojo
        to sync data with Java code on the server




© SitePen, Inc. 2008. All Rights Reserved
Dojo Data Store


          Java:

          // Load the data somehow
          Map<String, Person> ppl = ...;

          // Create an implementation of StoreProvider to hold the data
          MapStoreProvider provider = new MapStoreProvider(ppl, Person.class);

          // Tell DWR to expose the data to the internet
          Directory.register(quot;testServerDataquot;, provider);




© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

Hollywood vs Silicon Valley: Open Video als Vermittler
Hollywood vs Silicon Valley: Open Video als VermittlerHollywood vs Silicon Valley: Open Video als Vermittler
Hollywood vs Silicon Valley: Open Video als Vermittler

Hollywood is facing increasing competition from Silicon Valley as new digital platforms emerge for distributing entertainment content. New players like Netflix and Hulu are producing their own content and attracting viewers away from traditional television. As devices like smartphones and tablets proliferate, consumers are spending more time with digital content on multiple screens. For the entertainment industry to succeed, it will need to embrace new forms of storytelling, collaborate with digital platforms, and make content widely available across all devices and services.

webtvtvonline video
Film Titles
Film TitlesFilm Titles
Film Titles
Decisions and Time in the Information Society
Decisions and Time in the Information SocietyDecisions and Time in the Information Society
Decisions and Time in the Information Society

The document discusses how the accelerated pace of change in the information society challenges traditional linear policy-making models. It argues that policies need to shift from simply implementing decisions to also shaping emerging systems and behaviors over multiple time periods. Rather than directly controlling outcomes, policymakers should aim to stimulate collective creativity by formulating compelling images of future rules/systems and monitoring how actual systems evolve in response.

Dojo Data Store

          HTML:
          <table id=quot;gridquot; dojoType=quot;dojox.grid.DataGridquot; ><tr>
            <th field=quot;namequot; width=quot;120pxquot; editable=quot;truequot;>Name</th>
            ...
          </tr></table>



          JavaScript:
          dojo.registerModulePath(quot;dwrquot;, quot;path/from/dojo/to/dwrquot;);
          dojo.require(quot;dwr.data.Storequot;);

          dwrStore = new dwr.data.Store(quot;testServerDataquot;, { subscribe:true });
          dijit.byId(quot;gridquot;).setStore(dwrStore);




© SitePen, Inc. 2008. All Rights Reserved
Dojo Data Store


          Java:

          // The StoreProvider from earlier
          MapStoreProvider provider = ...

          // Get a representation of the internal data
          Map<String, Person> data = provider.asMap();

          // Mutate it
          data.addPerson(new Person(...));

          // The browsers viewing the data automagically update




© SitePen, Inc. 2008. All Rights Reserved
Dojo Data Store


        Why?
                 • Data-Sync APIs are hard to get right, but are really
                   simple to use
                 • There is lots of potential for network level
                   optimization




© SitePen, Inc. 2008. All Rights Reserved
JSON / JSONP / JSON-RPC



© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

6 Takes
6 Takes6 Takes
6 Takes

This short document suggests living life freely by dancing to your own rhythm, taking risks for fun, thinking outside the box, dreaming of adventures, exploring the world by bike, and having spontaneous experiences.

AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx

This power point presentation provides an overview of advance Java topics including servlets, session handling, database handling, JSP, Struts, MVC, and Hibernate. It begins with a brief introduction of Java and its history. It then discusses advance Java topics like J2EE, servlets, session handling using different techniques. It also covers database handling using JDBC and topics like JSP, Struts framework, MVC pattern, Tiles framework, and Hibernate for object-relational mapping.

Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework

Apache Wicket is a Java web application framework that uses a component-based programming model to build web UIs, allowing developers to treat page elements like buttons and labels as objects and handle events like clicks. It aims to bridge the gap between desktop and web development by enabling an event-driven programming style and component hierarchy similar to Swing. Wicket pages are composed of reusable Java components that correspond to HTML elements, avoiding the impedance mismatch between Java and HTTP programming models.

wicketjeejava
Dojo Data Store



        DWR now supports:
                 • plain JSON
                 • JSONP
                 • JSON-RPC




© SitePen, Inc. 2008. All Rights Reserved
JSONP

          Java:

          public class Demo {
            public sayHello(String name) {
              return quot;Hello, quot; + name;
            }
          }

          Shell:

          $ wget http://example.com/app/dwr/jsonp/Demo/sayHello? ↩
                                callback=callback&param0=quot;Joequot;

          -> callback(quot;Hello, Joequot;);




© SitePen, Inc. 2008. All Rights Reserved
JSONP
          Dojo:

          dojo.io.script.get({
            url:'http://example.com/app/dwr/jsonp/Demo/sayHello',
            content:{param:'Joe'}
          }).addCallback(function() { ... });

          JQuery:

          $.ajax({
            dataType:'jsonp',
            data:'param=Joe',
            url:'http://example.com/app/dwr/jsonp/Demo/sayHello',
            success:function () { ... },
          });



© SitePen, Inc. 2008. All Rights Reserved
JSON / JSONP / JSON-RPC


        Why?
                 • To allow DWR to remote functions to things other
                   than a DWR client
                 • ‘DWRP’ is designed to be something we can change
                   without a long deprecation process




© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015

My talk about the life of JavaScript, from birth to today. I went trough the demos and code examples very quickly, rather as a teaser to show how modern JavaScript development might look. If you are interested in a deep dive into the topic of modern JavaScript development, HTML5, ES6, AngularJS, React, Gulp, Grunt etc, please consider my courses: http://www.ivorycode.com/#schulung

javascript
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices

This document discusses best practices for developing RESTful APIs and backend services for mobile applications. It recommends using Java, Maven, Spring, Jersey, and Protocol Buffers. Protocol Buffers provide a compact data interchange format that is faster than JSON and more widely supported than other protocols. The document provides an example of implementing authentication, API throttling, caching, testing, and error handling in a RESTful service using these technologies.

javaciklum
Json generation
Json generationJson generation
Json generation

The document discusses using Java objects to generate JSON. It provides an overview of the steps involved, including setting response headers, getting the Java object result, converting it to a JSONObject using the org.json utilities, and outputting the JSONObject. Code samples are given for a servlet that performs these steps. Specifically, it shows calling a business logic method to get a Java result, converting it to a JSONObject, and printing the JSONObject to the response.

Varargs



© SitePen, Inc. 2008. All Rights Reserved
Varargs




        You can now call methods with a vararg parameter




© SitePen, Inc. 2008. All Rights Reserved
Varargs


          Java:

          public Remoted {
            public void method(String... arg) { ... }
          }

          JavaScript:

          Remoted.method(quot;Onequot;, quot;Twoquot;, quot;Threequot;);




© SitePen, Inc. 2008. All Rights Reserved
Varargs

        Why?
                 • It saves the hassle of wrapping options in an array
                   or collection before a method is called


        Alert:
                 • It could break some corner cases when mixing
                   servlet parameters with normal parameters




© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)

The document provides an overview of Java EE 7 including: - Major themes like ease of development, lightweight, and HTML5 support - New and updated specifications including JSF 2.2, JAX-RS 2.0, JPA 2.1, JMS 2.0, CDI 1.1, and more - Enhancements to the web profile, messaging, RESTful web services, persistence, and other APIs - New capabilities like support for JSON, WebSocket, schema generation, and batch processing

Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript

This document provides an overview of JavaScript concepts including: - Where JavaScript can run including web browsers and JavaScript engines. - Key differences from Java like JavaScript arriving as text with no compiler and need to work across runtime environments. - Tools for debugging and developing JavaScript like Firefox's Firebug and Chrome Developer Tools. - Variables, functions, objects, and inheritance in JavaScript compared to other languages like Java. Functions can be treated as first-class objects and assigned to properties or passed as callbacks.

javascript
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin Shanghai

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, especially for real-time web applications with many concurrent connections. The document discusses why Node.js uses an asynchronous and non-blocking model, why JavaScript was chosen as the language, and why the V8 engine is fast. It also explains why Node.js is threadless and memory efficient. Finally, it notes that the Node.js community is very active and creative.

nodejs
Overloaded Methods



© SitePen, Inc. 2008. All Rights Reserved
Overloaded Methods




        Previously DWR prevented you from reliably calling
        overloaded methods




© SitePen, Inc. 2008. All Rights Reserved
Overloaded Methods

          Java:
          public Remoted {
            public void method(int num) {
                         log.debug(quot;int method called with quot; + num);
                }
                 public void method(String str) {
                         log.debug(quot;String method called with quot; + str);
                }
          }

          JavaScript:
          Remoted.method(quot;String Paramquot;);
          Remoted.method(42);




© SitePen, Inc. 2008. All Rights Reserved
Overloaded Methods



        Why?
                 • It saves you from creating multiple proxy methods
                   to existing APIs




© SitePen, Inc. 2008. All Rights Reserved

Recommended for you

Why Node.js
Why Node.jsWhy Node.js
Why Node.js

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, especially for real-time web applications with many concurrent connections. The document discusses why Node.js uses an asynchronous and non-blocking model, why JavaScript was chosen as the language, and why the V8 engine is fast. It also explains why Node.js is threadless and memory efficient. Finally, it notes that the Node.js community is very active and creative.

node.jsnodecomet
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008

Dans cette session, Chris Wilson parlera d’Internet Explorer 8 et de ses avancées en termes de conformité aux standards et de prise en charge d’AJAX. Il illustrera aussi les nouvelles possibilités qui s’offrent aux responsables de sites Web.

pw2008
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyond

I had the privilege of giving a Yahoo! Tech Talk at their HQ in Sunnyvale. I spoke on Gears, App Engine, and other technologies such as the Ajax Libraries API and Doctype.

 
by dion
yahootechtalkappenginegears
What’s Next



© SitePen, Inc. 2008. All Rights Reserved
Top Directions for DWR 3.1

        Shorter release cycle
        Gears
        SMD
        Dojo:
                 • Reverse Ajax API support
                 • Auto-build
        Rest




© SitePen, Inc. 2008. All Rights Reserved
Any Questions?


        • http://directwebremoting.org
        • http://sitepen.com



© SitePen, Inc. 2008. All Rights Reserved

More Related Content

What's hot

Php1
Php1Php1
Dbms
DbmsDbms
SQL .pptx
SQL .pptxSQL .pptx
Database storage engines
Database storage enginesDatabase storage engines
Database storage engines
University of Sindh, Jamshoro
 
SQL2.pptx
SQL2.pptxSQL2.pptx
SQL2.pptx
RareDeath
 
3 - Integrity Constraints.pdf
3 - Integrity Constraints.pdf3 - Integrity Constraints.pdf
3 - Integrity Constraints.pdf
gaurav70287
 
Introduction to SQL Server Security
Introduction to SQL Server SecurityIntroduction to SQL Server Security
Introduction to SQL Server Security
Jason Strate
 
ORACLE PL SQL
ORACLE PL SQLORACLE PL SQL
ORACLE PL SQL
Srinath Maharana
 
Displaying data from multiple tables
Displaying data from multiple tablesDisplaying data from multiple tables
Displaying data from multiple tables
Syed Zaid Irshad
 
INTRODUCTION TO DATABASE
INTRODUCTION TO DATABASEINTRODUCTION TO DATABASE
INTRODUCTION TO DATABASE
Muhammad Bilal Tariq
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
prathap kumar
 
History of database processing module 1 (2)
History of database processing module 1 (2)History of database processing module 1 (2)
History of database processing module 1 (2)
chottu89
 
EDB Failover Manager - Features and Demo
EDB Failover Manager - Features and DemoEDB Failover Manager - Features and Demo
EDB Failover Manager - Features and Demo
EDB
 
Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a Database
Bishrul Haq
 
Intro to dbms
Intro to dbmsIntro to dbms
Intro to dbms
Surkhab Shelly
 
Data structure mind mapping
Data structure mind mapping Data structure mind mapping
Data structure mind mapping
Amr Hassan AbdUllah
 
Exercícios - Tutorial ETL com Pentaho Data Integration
Exercícios - Tutorial ETL com Pentaho Data IntegrationExercícios - Tutorial ETL com Pentaho Data Integration
Exercícios - Tutorial ETL com Pentaho Data Integration
Jarley Nóbrega
 
Partitioning
PartitioningPartitioning
Partitioning
Reema Gajjar
 
今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)
今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)
今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)
Takeshi Yoshida
 
introduction to database
 introduction to database introduction to database
introduction to database
Akif shexi
 

What's hot (20)

Php1
Php1Php1
Php1
 
Dbms
DbmsDbms
Dbms
 
SQL .pptx
SQL .pptxSQL .pptx
SQL .pptx
 
Database storage engines
Database storage enginesDatabase storage engines
Database storage engines
 
SQL2.pptx
SQL2.pptxSQL2.pptx
SQL2.pptx
 
3 - Integrity Constraints.pdf
3 - Integrity Constraints.pdf3 - Integrity Constraints.pdf
3 - Integrity Constraints.pdf
 
Introduction to SQL Server Security
Introduction to SQL Server SecurityIntroduction to SQL Server Security
Introduction to SQL Server Security
 
ORACLE PL SQL
ORACLE PL SQLORACLE PL SQL
ORACLE PL SQL
 
Displaying data from multiple tables
Displaying data from multiple tablesDisplaying data from multiple tables
Displaying data from multiple tables
 
INTRODUCTION TO DATABASE
INTRODUCTION TO DATABASEINTRODUCTION TO DATABASE
INTRODUCTION TO DATABASE
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
 
History of database processing module 1 (2)
History of database processing module 1 (2)History of database processing module 1 (2)
History of database processing module 1 (2)
 
EDB Failover Manager - Features and Demo
EDB Failover Manager - Features and DemoEDB Failover Manager - Features and Demo
EDB Failover Manager - Features and Demo
 
Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a Database
 
Intro to dbms
Intro to dbmsIntro to dbms
Intro to dbms
 
Data structure mind mapping
Data structure mind mapping Data structure mind mapping
Data structure mind mapping
 
Exercícios - Tutorial ETL com Pentaho Data Integration
Exercícios - Tutorial ETL com Pentaho Data IntegrationExercícios - Tutorial ETL com Pentaho Data Integration
Exercícios - Tutorial ETL com Pentaho Data Integration
 
Partitioning
PartitioningPartitioning
Partitioning
 
今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)
今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)
今日から始める XPages アプリケーション開発!(オープンセミナー 2016 ハンズオン XPagesDay 出張セッション)
 
introduction to database
 introduction to database introduction to database
introduction to database
 

Viewers also liked

SBML: What Is It About?
SBML: What Is It About?SBML: What Is It About?
SBML: What Is It About?
Mike Hucka
 
Lenovo's 'Idea Tweetathon' Contest Guidelines
Lenovo's 'Idea Tweetathon' Contest GuidelinesLenovo's 'Idea Tweetathon' Contest Guidelines
Lenovo's 'Idea Tweetathon' Contest Guidelines
Lenovo
 
Cross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORSCross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORS
Michael Neale
 
The Role of Standards in BPM
The Role of Standards in BPMThe Role of Standards in BPM
The Role of Standards in BPM
Sandy Kemsley
 
Specialist in personal injury law
Specialist in personal injury lawSpecialist in personal injury law
Specialist in personal injury law
Paramount Lawyers
 
The Most Misunderstood “Buzzword” of All Time: Content Marketing
The Most Misunderstood “Buzzword” of All Time: Content MarketingThe Most Misunderstood “Buzzword” of All Time: Content Marketing
The Most Misunderstood “Buzzword” of All Time: Content Marketing
Ghergich & Co.
 
Halkin Dusmanlari
Halkin DusmanlariHalkin Dusmanlari
Halkin Dusmanlari
kaanay
 
Streamlining the Quota Process for a World-Class Sales Organization
Streamlining the Quota Process for a World-Class Sales OrganizationStreamlining the Quota Process for a World-Class Sales Organization
Streamlining the Quota Process for a World-Class Sales Organization
Callidus Software
 
Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)
Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)
Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)
Andrea Rossetti
 
Callidus Software Product Suite Overview: What's New
Callidus Software Product Suite Overview: What's NewCallidus Software Product Suite Overview: What's New
Callidus Software Product Suite Overview: What's New
Callidus Software
 
Agencies Blogging
Agencies BloggingAgencies Blogging
Agencies Blogging
Seth Gaffney
 
APMP Knowledge Sharing Tools 11 Oct07
APMP  Knowledge Sharing Tools 11 Oct07APMP  Knowledge Sharing Tools 11 Oct07
APMP Knowledge Sharing Tools 11 Oct07
guest66ff7d
 
01 Paolo Lessio, Processo civile telematico
01 Paolo Lessio, Processo civile telematico01 Paolo Lessio, Processo civile telematico
01 Paolo Lessio, Processo civile telematico
Andrea Rossetti
 
02 - Paolo Lessio, Processo civile telematico
02 - Paolo Lessio, Processo civile telematico02 - Paolo Lessio, Processo civile telematico
02 - Paolo Lessio, Processo civile telematico
Andrea Rossetti
 
New Media Addicts Anonymous
New Media Addicts AnonymousNew Media Addicts Anonymous
New Media Addicts Anonymous
Geert Wissink
 
Andrea Cavalloni, Digital Rights Management: Il caso Sony-BMG
Andrea Cavalloni, Digital Rights Management:Il caso Sony-BMGAndrea Cavalloni, Digital Rights Management:Il caso Sony-BMG
Andrea Cavalloni, Digital Rights Management: Il caso Sony-BMG
Andrea Rossetti
 
Hollywood vs Silicon Valley: Open Video als Vermittler
Hollywood vs Silicon Valley: Open Video als VermittlerHollywood vs Silicon Valley: Open Video als Vermittler
Hollywood vs Silicon Valley: Open Video als Vermittler
Bertram Gugel
 
Film Titles
Film TitlesFilm Titles
Film Titles
mezusa
 
Decisions and Time in the Information Society
Decisions and Time in the Information SocietyDecisions and Time in the Information Society
Decisions and Time in the Information Society
jexxon
 
6 Takes
6 Takes6 Takes
6 Takes
Laurakneale
 

Viewers also liked (20)

SBML: What Is It About?
SBML: What Is It About?SBML: What Is It About?
SBML: What Is It About?
 
Lenovo's 'Idea Tweetathon' Contest Guidelines
Lenovo's 'Idea Tweetathon' Contest GuidelinesLenovo's 'Idea Tweetathon' Contest Guidelines
Lenovo's 'Idea Tweetathon' Contest Guidelines
 
Cross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORSCross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORS
 
The Role of Standards in BPM
The Role of Standards in BPMThe Role of Standards in BPM
The Role of Standards in BPM
 
Specialist in personal injury law
Specialist in personal injury lawSpecialist in personal injury law
Specialist in personal injury law
 
The Most Misunderstood “Buzzword” of All Time: Content Marketing
The Most Misunderstood “Buzzword” of All Time: Content MarketingThe Most Misunderstood “Buzzword” of All Time: Content Marketing
The Most Misunderstood “Buzzword” of All Time: Content Marketing
 
Halkin Dusmanlari
Halkin DusmanlariHalkin Dusmanlari
Halkin Dusmanlari
 
Streamlining the Quota Process for a World-Class Sales Organization
Streamlining the Quota Process for a World-Class Sales OrganizationStreamlining the Quota Process for a World-Class Sales Organization
Streamlining the Quota Process for a World-Class Sales Organization
 
Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)
Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)
Stefano Ricci, PRIVACY E SERVIZI DELLA SOCIETA' DELL'INFORMAZIONE (2)
 
Callidus Software Product Suite Overview: What's New
Callidus Software Product Suite Overview: What's NewCallidus Software Product Suite Overview: What's New
Callidus Software Product Suite Overview: What's New
 
Agencies Blogging
Agencies BloggingAgencies Blogging
Agencies Blogging
 
APMP Knowledge Sharing Tools 11 Oct07
APMP  Knowledge Sharing Tools 11 Oct07APMP  Knowledge Sharing Tools 11 Oct07
APMP Knowledge Sharing Tools 11 Oct07
 
01 Paolo Lessio, Processo civile telematico
01 Paolo Lessio, Processo civile telematico01 Paolo Lessio, Processo civile telematico
01 Paolo Lessio, Processo civile telematico
 
02 - Paolo Lessio, Processo civile telematico
02 - Paolo Lessio, Processo civile telematico02 - Paolo Lessio, Processo civile telematico
02 - Paolo Lessio, Processo civile telematico
 
New Media Addicts Anonymous
New Media Addicts AnonymousNew Media Addicts Anonymous
New Media Addicts Anonymous
 
Andrea Cavalloni, Digital Rights Management: Il caso Sony-BMG
Andrea Cavalloni, Digital Rights Management:Il caso Sony-BMGAndrea Cavalloni, Digital Rights Management:Il caso Sony-BMG
Andrea Cavalloni, Digital Rights Management: Il caso Sony-BMG
 
Hollywood vs Silicon Valley: Open Video als Vermittler
Hollywood vs Silicon Valley: Open Video als VermittlerHollywood vs Silicon Valley: Open Video als Vermittler
Hollywood vs Silicon Valley: Open Video als Vermittler
 
Film Titles
Film TitlesFilm Titles
Film Titles
 
Decisions and Time in the Information Society
Decisions and Time in the Information SocietyDecisions and Time in the Information Society
Decisions and Time in the Information Society
 
6 Takes
6 Takes6 Takes
6 Takes
 

Similar to What's new in DWR version 3

AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
SachinSingh217687
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework
Luther Baker
 
The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015
jbandi
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
ciklum_ods
 
Json generation
Json generationJson generation
Json generation
Aravindharamanan S
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)
Hamed Hatami
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
Yakov Fain
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin Shanghai
Jackson Tian
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.js
guileen
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
Association Paris-Web
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyond
dion
 
Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...
Boris Kravtsov
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
José Paumard
 
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting started with Websocket and Server-sent Events using Java - Arun Gupta Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
jaxconf
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
Clinton Dreisbach
 
Ajax with DWR
Ajax with DWRAjax with DWR
Ajax with DWR
gouthamrv
 
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Getting Started with WebSocket and Server-Sent Events using Java by Arun GuptaGetting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Codemotion
 
Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014
Jagadish Prasath
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
John Brunswick
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
John Quaglia
 

Similar to What's new in DWR version 3 (20)

AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework
 
The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
 
Json generation
Json generationJson generation
Json generation
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin Shanghai
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.js
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyond
 
Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
 
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting started with Websocket and Server-sent Events using Java - Arun Gupta Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
Ajax with DWR
Ajax with DWRAjax with DWR
Ajax with DWR
 
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Getting Started with WebSocket and Server-Sent Events using Java by Arun GuptaGetting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
 
Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
 

Recently uploaded

Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 

Recently uploaded (20)

Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 

What's new in DWR version 3

  • 1. What’s new in DWR v3 Joe Walker DWR Lead Developer SitePen UK
  • 2. Recap Since we last talked ... Named Parameters Binary Files JavaScript Extending Java Better Reverse Ajax Data Sync: Dojo Data Store JSON / JSONP / JSON-RPC Varargs and Overloaded Methods What’s Next © SitePen, Inc. 2008. All Rights Reserved
  • 3. Recap © SitePen, Inc. 2008. All Rights Reserved
  • 4. © SitePen, Inc. 2008. All Rights Reserved
  • 5. Marshalling Types Primitive types, and their Object counterparts int, boolean, long, float, double, etc Obvious classes String, Date, BigDecimal, BigInteger, Enum, etc Arrays and Collections Map, List, Set, Iterator, ... JavaBeans and Objects XML objects DOM, XOM, JDom, Dom4J © SitePen, Inc. 2008. All Rights Reserved
  • 6. © SitePen, Inc. 2008. All Rights Reserved
  • 7. Since we last talked ... TIBCO General Interface SitePen http://svn.directwebremoting.org © SitePen, Inc. 2008. All Rights Reserved
  • 8. Named Parameters © SitePen, Inc. 2008. All Rights Reserved
  • 9. Named Parameters DWR will create client-side classes to look like server-side classes to make passing parameters easy © SitePen, Inc. 2008. All Rights Reserved
  • 10. Named Parameters Java: public interface Person { ... } public class Employee implements Person { ... } public class Manager extends Employee { ... } public HumanResources { public void addPerson(Person p) { ... } } JavaScript: Manager m = new Manager(); HumanResources.addPerson(m); © SitePen, Inc. 2008. All Rights Reserved
  • 11. Named Parameters Why? • Inheritance is useful in places • It saves creating addEmployee() and addManager() methods © SitePen, Inc. 2008. All Rights Reserved
  • 12. Lightweight Named Parameters © SitePen, Inc. 2008. All Rights Reserved
  • 13. Lightweight Named Parameters DWR also allows a lighter-weight method of declaring types © SitePen, Inc. 2008. All Rights Reserved
  • 14. Lightweight Named Parameters Java: public interface Person { ... } public class Employee implements Person { ... } public class Manager extends Employee { ... } public HumanResources { public void addPerson(Person p) { ... } } JavaScript: var m = { $dwrClassName:'Manager', firstname:'Joe', ...}; HumanResources.addPerson(m); © SitePen, Inc. 2008. All Rights Reserved
  • 15. Lightweight Named Parameters Why? • Everything as for Named Parameters • But sometimes you get an object from somewhere else © SitePen, Inc. 2008. All Rights Reserved
  • 16. Binary Files: File Upload © SitePen, Inc. 2008. All Rights Reserved
  • 17. Binary Files: File Upload DWR has always had a long list of things that it will marshall including Dates, DOM trees, etc In addition, DWR will now marshall binary files just as if they were the text resources it handles now © SitePen, Inc. 2008. All Rights Reserved
  • 18. Binary Files: File Upload Java: public Remoted { public void receiveBinaryFile(byte[] uploaded) { ... } } HTML: <input id='fileId' type='file'/> JavaScript: var binary = dwr.util.getValue('fileId'); Remoted.receiveBinaryFile(binary); © SitePen, Inc. 2008. All Rights Reserved
  • 19. Binary Files: File Upload Will marshall to: • byte[] • java.awt.BufferedImage • java.io.InputStream • org.directwebremoting.io.FileTransfer (gives access to filename and mime-type in addition to the contents) © SitePen, Inc. 2008. All Rights Reserved
  • 20. Binary Files: File Upload Why? • This is a lot easier than using commons-fileupload or similar • We can provide integration with progress bar widgets © SitePen, Inc. 2008. All Rights Reserved
  • 21. Binary Files: Download © SitePen, Inc. 2008. All Rights Reserved
  • 22. Binary Files: Download Binary file handling is 2 way. It’s good for: • Images • PDF files • Word, Excel documents • etc. © SitePen, Inc. 2008. All Rights Reserved
  • 23. Binary Files: Download Java: public Remoted { public void getPDF(String contents) { ByteArrayOutputStream buf = new ByteArrayOutputStream(); Document doc = new Document(); PdfWriter.getInstance(doc, buf); doc.open(); doc.add(new Paragraph(contents)); doc.close(); return new FileTransfer(quot;ex.pdfquot;, quot;application/pdfquot;, buf.toByteArray()); } JavaScript: Remoted.getPDF('Joe', function(data) { dwr.engine.openInDownload(data); }); © SitePen, Inc. 2008. All Rights Reserved
  • 24. Binary Files: Download Why? • This is a lot easier than creating a special PDF/ image/etc serving servlet © SitePen, Inc. 2008. All Rights Reserved
  • 25. Javascript extending Java © SitePen, Inc. 2008. All Rights Reserved
  • 26. Javascript extending Java DWR will allow you to implement Java interfaces using JavaScript © SitePen, Inc. 2008. All Rights Reserved
  • 27. Javascript extending Java Java: public interface BazListener { void somethingChanged(String msg); } public class Remote { public void addBazListener(BazListener bl) { ... } public void calledLater() { for (BazListener bl : listeners) bl.somethingChanged(quot;JS objects can implement Java interfacesquot;); } ... } JavaScript: function BazListener() {this.$dwrByRef;} BazListener.prototype.somethingChanged = function(msg){alert(msg);}; var bl = new BazListener(); Remote.addBazListener(bl); © SitePen, Inc. 2008. All Rights Reserved
  • 28. Javascript extending Java Why? • Intuitive way to interact • Easy Pub-sub • Allows interaction with existing APIs © SitePen, Inc. 2008. All Rights Reserved
  • 29. Scalable Reverse Ajax © SitePen, Inc. 2008. All Rights Reserved
  • 30. Scalable Reverse Ajax Previously there were some scalability limitations with the 2.0 reverse ajax API. 3.0 deprecates the problem areas. © SitePen, Inc. 2008. All Rights Reserved
  • 31. Scalable Reverse Ajax Reverse Ajax proxies no longer take a list of ScriptSessions in the constructor, they just write to the current ‘destination’ The Browser API allows you to change the current ‘destination’ © SitePen, Inc. 2008. All Rights Reserved
  • 32. Scalable Reverse Ajax // The default destination is the browser // that caused the current action to happen. Window.alert(quot;Helloquot;); // Non DWR thread have no default destination Thread t = new Thread(new Runnable()) { public void run() { // Error Window.alert(quot;Helloquot;); } }); © SitePen, Inc. 2008. All Rights Reserved
  • 33. Scalable Reverse Ajax // Set the destination to be all browsers that // are looking at the current page Browser.withCurrentPage(new Runnable()) { public void run() { Window.alert(quot;Helloquot;); } }); // Set the destination to be all browsers that // are looking at the current page Browser.withCurrentPage(quot;index.htmlquot;, new Runnable()) { public void run() { Window.alert(quot;Helloquot;); } }); © SitePen, Inc. 2008. All Rights Reserved
  • 34. Scalable Reverse Ajax // Broadcast to everyone Browser.withAllSessions(...); // Broadcast to subsets Browser.with*Filtered(scriptSesssionFilter, ...); // To a known individual Browser.withSession(sessionId, ...); © SitePen, Inc. 2008. All Rights Reserved
  • 35. Scalable Reverse Ajax Why? • It’s generally easier to use • It decouples generation from routing • It scales © SitePen, Inc. 2008. All Rights Reserved
  • 36. Reverse Ajax APIs © SitePen, Inc. 2008. All Rights Reserved
  • 37. Reverse Ajax APIs Reverse Ajax != Comet Reverse Ajax == Comet + Polling + Piggyback © SitePen, Inc. 2008. All Rights Reserved
  • 38. Reverse Ajax APIs: JS Level // Low level: Use server-side W3C DOM methods Element ele = doc.createElement(quot;pquot;); ScriptSessions.addFunctionCall( quot;document.body.appendChildquot;, ele); © SitePen, Inc. 2008. All Rights Reserved
  • 39. Reverse Ajax APIs: JS Level // Low level: Any arbitrary JavaScript String s = quot;if (document.all) window.alert('IE');quot;; ScriptSessions.addScript(s); © SitePen, Inc. 2008. All Rights Reserved
  • 40. Reverse Ajax APIs: DOM Level // Some methods from Window and Document import javax.servlet.http.Cookie; import org.directwebremoting.ui.browser.Document; Cookie c = new Cookie(quot;namequot;, quot;valuequot;); Document.setCookie(c); © SitePen, Inc. 2008. All Rights Reserved
  • 41. Reverse Ajax APIs: dwr.util // dwr.util in Java import org.directwebremoting.ui.dwr.Util; String[] opts = new String[] {quot;onequot;,quot;twoquot;,...}; Util.addOptions(quot;liquot;, opts); © SitePen, Inc. 2008. All Rights Reserved
  • 42. Reverse Ajax APIs: Scriptaculous // Scriptaculous Effects in Java import org.directwebremoting.ui.scriptaculous.Effect; Effect.fade(quot;someIdquot;); © SitePen, Inc. 2008. All Rights Reserved
  • 43. Reverse Ajax APIs: TIBCO GI // TIBCO General Interface in Java import jsx3.GI; import jsx3.app.*; import jsx3.gui.*; Server server = GI.getServer(quot;servernamequot;); TextBox phoneNum = server.getJSXByName(quot;phoneNumquot;, TextBox.class); phoneNum.setValue(quot;servernamequot;); © SitePen, Inc. 2008. All Rights Reserved
  • 44. Reverse Ajax APIs: Dojo // Dojo in Java import org.dojotoolkit.dijit.Dijit; import org.dojotoolkit.dijit.Editor; Editor e = Dijit.byId(quot;pricequot;, Editor.class); e.setValue(42); © SitePen, Inc. 2008. All Rights Reserved
  • 45. Scalable Reverse Ajax Why? • A full range of APIs for dynamically updating client data • DWR doesn’t do widgets, but it does talk to the people that do Drapgen can be used to create and maintain large APIs © SitePen, Inc. 2008. All Rights Reserved
  • 46. Dojo Data Store © SitePen, Inc. 2008. All Rights Reserved
  • 47. Dojo Data Store DWR now implements all 4 interfaces to allow Dojo to sync data with Java code on the server © SitePen, Inc. 2008. All Rights Reserved
  • 48. Dojo Data Store Java: // Load the data somehow Map<String, Person> ppl = ...; // Create an implementation of StoreProvider to hold the data MapStoreProvider provider = new MapStoreProvider(ppl, Person.class); // Tell DWR to expose the data to the internet Directory.register(quot;testServerDataquot;, provider); © SitePen, Inc. 2008. All Rights Reserved
  • 49. Dojo Data Store HTML: <table id=quot;gridquot; dojoType=quot;dojox.grid.DataGridquot; ><tr> <th field=quot;namequot; width=quot;120pxquot; editable=quot;truequot;>Name</th> ... </tr></table> JavaScript: dojo.registerModulePath(quot;dwrquot;, quot;path/from/dojo/to/dwrquot;); dojo.require(quot;dwr.data.Storequot;); dwrStore = new dwr.data.Store(quot;testServerDataquot;, { subscribe:true }); dijit.byId(quot;gridquot;).setStore(dwrStore); © SitePen, Inc. 2008. All Rights Reserved
  • 50. Dojo Data Store Java: // The StoreProvider from earlier MapStoreProvider provider = ... // Get a representation of the internal data Map<String, Person> data = provider.asMap(); // Mutate it data.addPerson(new Person(...)); // The browsers viewing the data automagically update © SitePen, Inc. 2008. All Rights Reserved
  • 51. Dojo Data Store Why? • Data-Sync APIs are hard to get right, but are really simple to use • There is lots of potential for network level optimization © SitePen, Inc. 2008. All Rights Reserved
  • 52. JSON / JSONP / JSON-RPC © SitePen, Inc. 2008. All Rights Reserved
  • 53. Dojo Data Store DWR now supports: • plain JSON • JSONP • JSON-RPC © SitePen, Inc. 2008. All Rights Reserved
  • 54. JSONP Java: public class Demo { public sayHello(String name) { return quot;Hello, quot; + name; } } Shell: $ wget http://example.com/app/dwr/jsonp/Demo/sayHello? ↩ callback=callback&param0=quot;Joequot; -> callback(quot;Hello, Joequot;); © SitePen, Inc. 2008. All Rights Reserved
  • 55. JSONP Dojo: dojo.io.script.get({ url:'http://example.com/app/dwr/jsonp/Demo/sayHello', content:{param:'Joe'} }).addCallback(function() { ... }); JQuery: $.ajax({ dataType:'jsonp', data:'param=Joe', url:'http://example.com/app/dwr/jsonp/Demo/sayHello', success:function () { ... }, }); © SitePen, Inc. 2008. All Rights Reserved
  • 56. JSON / JSONP / JSON-RPC Why? • To allow DWR to remote functions to things other than a DWR client • ‘DWRP’ is designed to be something we can change without a long deprecation process © SitePen, Inc. 2008. All Rights Reserved
  • 57. Varargs © SitePen, Inc. 2008. All Rights Reserved
  • 58. Varargs You can now call methods with a vararg parameter © SitePen, Inc. 2008. All Rights Reserved
  • 59. Varargs Java: public Remoted { public void method(String... arg) { ... } } JavaScript: Remoted.method(quot;Onequot;, quot;Twoquot;, quot;Threequot;); © SitePen, Inc. 2008. All Rights Reserved
  • 60. Varargs Why? • It saves the hassle of wrapping options in an array or collection before a method is called Alert: • It could break some corner cases when mixing servlet parameters with normal parameters © SitePen, Inc. 2008. All Rights Reserved
  • 61. Overloaded Methods © SitePen, Inc. 2008. All Rights Reserved
  • 62. Overloaded Methods Previously DWR prevented you from reliably calling overloaded methods © SitePen, Inc. 2008. All Rights Reserved
  • 63. Overloaded Methods Java: public Remoted { public void method(int num) { log.debug(quot;int method called with quot; + num); } public void method(String str) { log.debug(quot;String method called with quot; + str); } } JavaScript: Remoted.method(quot;String Paramquot;); Remoted.method(42); © SitePen, Inc. 2008. All Rights Reserved
  • 64. Overloaded Methods Why? • It saves you from creating multiple proxy methods to existing APIs © SitePen, Inc. 2008. All Rights Reserved
  • 65. What’s Next © SitePen, Inc. 2008. All Rights Reserved
  • 66. Top Directions for DWR 3.1 Shorter release cycle Gears SMD Dojo: • Reverse Ajax API support • Auto-build Rest © SitePen, Inc. 2008. All Rights Reserved
  • 67. Any Questions? • http://directwebremoting.org • http://sitepen.com © SitePen, Inc. 2008. All Rights Reserved