Browse Prior Art Database

System or Method for transparently converting and passing objects between a Java based Controller/Model server and a JavaScript based View client

IP.com Disclosure Number: IPCOM000237661D
Publication Date: 2014-Jul-02
Document File: 4 page(s) / 64K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a method to annotate Plain Old Java Objects (POJOs) or interfaces so that the conversion between the POJO (or subclass or implementation) and a JavaScript Object Notation (JSON) and vice versa can be transparently automated at runtime. Further, by inserting logic at the Hypertext Transfer Protocol (HTTP) Servlet layer (the gateway between the Java and JavaScript environments) through simple inheritance, objects can be transparently passed back and forth between the Java and JavaScript developers without the need to manage serialization/deserialization.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 34% of the total text.

Page 01 of 4

System or Method for transparently converting and passing objects between a Java based Controller/Model server and a JavaScript based View client

Increasingly, products and applications are moving to the World Wide Web and away from native fat client interfaces. This creates a division in the programming model between the Java* based server side (where required services such as centralized

databases, persistent storage, and more computing power often exist) and JavaScript** browser client (where user interaction and graphical displays are leveraged). There is typically a traditional Model-View-Controller split with the Model and Controller existing on the server side and the View running in the browser.

As web-based interfaces become more powerful with the continued investment in Hypertext Markup Language (HTML) 5 and JavaScript frameworks, more complex interaction and visualization is taking place in the browser. As a result, both simple and complex data structures often need to be passed back and forth between the server side - expecting to manipulate Plain Old Java Objects (POJOs) - and the browser - expecting JavaScript Object Notation (JSON) Objects.

A method is needed to represent and pass these potentially complex data structures

back and forth between the two environments without interfering with the goal of developing a single seamless system.

One obvious solution is to manually write marshallers and demarshallers for these objects and manually call the marshallers on the way out and the demarshallers on the

way in. This results in unnecessary, tedious, and error-prone routines that need to be

written by developers. It also violates a separation of concerns between the Model,

View, and Controller as the Model developer must understand and transform objects into the format used by the View developer and vice versa.

Separately implemented routines can also result in proprietary code per developer that is hard to understand between developers and does not follow a well-established format.

Lastly, it undercuts the value of object-oriented design, as marshallers and demarshallers written by individual developers make it hard to enforce interfaces between the JavaScript developers and Java developers (see the example below related to TreeNodes).

The novel contribution is a means to annotate POJOs or interfaces so that the conversion between the POJO (or subclass or implementation) and a JSON Object and vice versa can be transparently automated at runtime. Further, by inserting logic at the Hypertext Transfer Protocol (HTTP) Servlet layer (the gateway between the Java and JavaScript environments) through simple inheritance, objects can be transparently passed back and forth between the Java and JavaScript developers without the need to manage serialization/deserialization.

1


Page 02 of 4

Finally, by integrating directly into the Java interface and inheritance scheme, the method can enforce requirements expected of JSON objects...