The Past, Present and Future of Rich Internet Applications
Anders Norås Solutions Architect, MCSD http://dotnetjunkies.com/weblog/anoras/
Speaker.getDetails(); Solutions Architect for Objectware. Ten years of experience developing business applications.
Mainly using J2EE & Microsoft .NET technologies.
Agenda What are Rich Internet Applications? Ajax’ history. How can I use Ajax to build ”Chubby Clients”? Creating an agile ”Chubby Client” architecture. The future of Rich Internet Applications.
The Ebb and Flow of Client Technologies
2005
Rich Internet Applications (RIA) & Smart Clients
Reach
1998
1992 Richness
Why Rich Internet Applications? Users and IT-organizations frustrated with the limitations of HTML. Providing a superior customer experience is a key business differentiator. The “boom” resulted in web applications that are difficult to use, costly to support and ineffective.
Elements of Rich Internet Applications
Asynchronous capabilities.
Gives more responsive applications.
Multi-step processes.
Interaction-support aid users.
Proper client side validation.
Helps users fill in forms with greater speed and accuracy.
Direct manipulation.
Enables more intuitive user interfaces.
Key RIA Technologies Macromedia Flex Microsoft Extensible Application Markup Language (XAML) Mozilla XML User Interface Language (XUL) Java Networked Desktop Components (JNDC) Windows Forms Smart Clients (.NET) Plain old HTML pages
”Chubby Client”?
D HT M L A
C
JAX
Smart vs. “Chubby”
Smart Data Management Tough To Deploy Tough To Update Fragile “DLL/ CLASSPATH hell” Rich User Experience Offline Capable High Developer Productivity Responsive & Flexible Easy To Deploy Easy To Manage Limited User Experience Easy To Update Network Dependency
Complex To Develop
Rich Clients
Smart Connection Management
Thin Clients
“Chubby” Clients Smart Clients
Examples of ”Cubby Client” Applications
Outlook 2003 Web Access Custom CRM application
Examples of ”Cubby Client” Applications
Microsoft SharePoint Amazon A9 Google.*
Ajax’ History
96 97 98 99 00 01 02 03 04 05
Netscape 2.0 released. First browser to support Java, frames and JavaScript
The Browser Wars
Revenge of the ”Smart Client”
The Birth of “Ajax”: Frames-Based RPC
Application Page (HTML)
Biz Logic
Callback Function
Hidden Frame (JSP)
RPC Stub
HTTP Get
Ajax’ History
96 97 98 99 00 01 02 03 04 05
ASP.NET 2.0 Macromedia Flex released
Netscape 2.0 released. First browser to support Java, frames and JavaScript Netscape 4.0ß1 released. DHTML is born. Microsoft Remote Scripting released SOAP 98. Microsoft Web Service Behavior released Sun advocate thin clients
.NET released. Strong focus on WinForms & Web Services Java WebStart First “Smart Client” framework Ashley IT Continues develop MSRS
AJAX
JDNC A new birth for desktop Java
The Browser Wars
Revenge of the ”Smart Client”
JS Phone Home: XMLHttpRequest
Using Ajax to Build ”Chubby Clients”
Ajax as seen today is great for enriched user experiences… …but most web based business applications can be radically improved by adopting client / server like features.
Java Script Object Notation (JSON) Lightweight data-interchange format. Based on ECMA 262 object literal, but is language independent. Built on two data structures:
Name/value pair collections. Ordered lists of values.
Implementations exist for a variety of programming languages.
JavaScript, Java, C#, Ruby, Perl amongst others.
Remote Procedure Calls using JSON-RPC
function doStuff() { var sql=“SELECT * FROM users WHERE clue > 0”; }
JSON-RPC
JSON RPC – Pros and Cons Elegant, lightweight, human readable format. Good framework support. The technology isn’t widely adopted. Applications can become chatty if used without caution.
Building Manageable ”Chubby Clients”
Write JavaScript code as if it was Java code.
Separate features in different libraries instead of writing one “big ball of mud”. Use JSUnit to test your code. Use platform features, such as XMLHttpRequest. Use common design patterns to ”abstract away” browser differences. Be careful what you bring into your projects from the web.
Avoid passing overly complex types between server code and the browser. Keep the service boundaries explicit.
Serializing Beans Using XMLEncoder & XMLDecoder
<
l> xm
XMLEncoder / XMLDecoder - Pros and Cons
Lightweight
Streams are small Few lines of code in both client and server application
Proprietary Tightly coupled XML representation isn’t self contained Server Client is a breeze; Client Server isn’t.
Using Web Services from the Browser Microsoft Web Service Behavior Gecko WSDL proxying
How Stuff Works: SOAP Style XML Serialization
Customer
Address City Country Country Firstname MiddleName Postalcode PostalCode Surname
.. .. .. .. .. .. ..
XML Serialization: Passing a JavaScript Object as an Argument to an Axis Web Service
m
How Stuff Works: Xml Deserialization
.. .. .. .. .. Postalcode .. ...
What am I?
Where do I belong?
Postalcode
What am I supposed to do?
I NEED HELP!!!!!
XML Schema
Returning an Object from an Axis Web Service to a Java Script Client
xm <
l>
XmlSerialization – Pros and Cons SOAP Document Literal is the de facto datainterchange format. Web Service endpoints can easily be reused across a variety of applications. Messages are self-contained when paired with WSDLs. Integration code can be “heavy”. The aftermaths of the browser wars make cross browser development difficult.
Creating an Agile “Chubby” Architecture Leverage existing business logic. Decompose presentation, integration and data. Rely on browser features and third party controls before rolling your own. Write script code as if it was server code. Ensure Document / Literal style when developing web services. Use self-contained, disconnected entities as often as possible to avoid chatty RPC interfaces.
The Future of “Chubby” Clients The rumors of the browser’s death are greatly exaggerated. The emergence of Smart Clients will increase the demand for intuitive web UIs. “Chubby Clients” enables a gradual transition to richer UIs for key applications in your portfolio. Exploit SOAs in web clients.
Summary Increasing demand for more intuitive UIs. If you can; create Smart Clients, otherwise fatten thin clients. “Chubby Clients” are trivial to develop in modern browsers.
Resources
JSON
JSON: http://www.json.org JSON for Java: http://www.crockford.com/JSON/java/index.html JSON-RPC Java ORB: http://oss.metaparadigm.com/jsonrpc/ Apache AXIS: http://ws.apache.org/axis/ Microsoft Web Service Behavior: http://msdn.microsoft.com/workshop/author/webservice/overview.asp Gecko WSDL Proxying: http://developer.mozilla.org/en/docs/Accessing_Web_Services_in_Mozilla_Using_WSDL_Proxying
Web Services
XML Serialization:
JavaScript XML Serializer: http://dotnetjunkies.com/WebLog/anoras/archive/2004/08/13/21962.aspx
Tools
Fiddler HTTP Debugger: http://www.fiddlertool.com/fiddler/ MindReef SOAP Scope: http://www.mindreef.com JSUnit: http://www.edwardh.com/jsunit/