|
|
YOUR FEEDBACK
SOA World Conference
Virtualization Conference $200 Savings Expire May 16, 2008... – Register Today! Did you read today's front page stories & breaking news?
SYS-CON.TV |
TOP THREE LINKS YOU MUST CLICK ON News Desk
The Next Web Development Episode Is RIA + SOA
Rich Web 2.0 applications will not become mainstream until the next generation of web platforms
By: Nolan Wright
Apr. 2, 2008 02:45 PM
Digg This!
Page 3 of 3
« previous page
These
two examples accomplish the same thing, but in very different ways. The first example requires more code and it’s
all in Javascript. The second example
uses a simple expression language to do the same thing. Let’s take a closer look at the syntax. on=”change
then r:load.combo2.request” In
this expression, the on=”r:load.combo2.response
then value[property=rows,text=text,value=value]” When
the Let’s
take this example one step further by adding a visual queue when the response message
is received. <select
id=”comboTwo” on=”r:load.combo2.response then
value[property=rows,text=text,value=value] and effect[Highlight]”> </select> By
adding and
effect[Highlight] to our expression, we are able to incorporate a subtle effect that lets the
user know that the combo box values have changed. These
code examples demonstrate the power and simplicity of a fully integrated
approach to event handling, DOM manipulation and Ajax. Developers that have little to no Javascript
experience will find it easy to learn an expression language like the one
above. It will enable them to get
productive quickly, since they don’t have to climb a steep learning curve. Of course, there are developers that are
comfortable with Javascript and would prefer to use it. As a result, an integrated RIA programming
model should also support the use of Javascript, specifically in a way the
supports the separation of behavior from markup. This is commonly referred to as unobtrusive
Javascript. Let’s look at an example: <img
id=”progress_image” src=”images/indicator.gif”/> $(“progress_images”).on(“r:login.request
then show”).on(“r:login.response then hide”); In
this example, the <img>
markup
is separate from the Javascript code that defines its behavior – i.e., “show”
when the login request message is received and “hide” when the login response
is received. This type of programming
model is good for developers that prefer to do their RIA programming in
Javascript. Provide an
Integrated Services Platform RIA
only gets us halfway to our goal of building a rich application. We still need to provide an answer for the
SOA piece of RIA + SOA. Unfortunately,
the current crop of Web 2.0 toolkits and frameworks primarily focus on RIA;
they provide little to no support for building services. This is problematic because developers are,
once again, left to bridge the gap, which makes application development and
maintenance unnecessarily more time consuming and difficult than it should
be. A
next generation RIA + SOA platform must address this gap by providing an
integrated services platform that provides the following:
@Service
(request = ‘login.request’, response =’login.response’) protected
void loginRequest (Message req, Message resp) throws Exception { String username =
req.getData().getString(“username”); String password =
req.getData().getString(“password”); User user = UserDAO.login(username,password); if (user !=null) { response.getData().put(“success”,true); response.getData().put(“user”,user); return; } response.getData().put(“success”,false); } <!--
Progress indicator --> <img
src=”images/indicator.gif” style=”display:none on=”r:login.request
then show or r:login.response then hide”/> <!--
Login form --> Username:
<input type=text” fieldset=”login” id=”username”/> Password:
<input type=”password” fieldset=”login” id=”password”/> <input
type=”button” value=”Login” on=”click then
r:login.request”/> Login Form <app:script
on=”r:login.request then execute after 1s”> $MQ(‘r:login.response’,{‘success’:true,’username’:’foo’}); </app:script> Mock Service In
the example above, we have a login form that generates the service request r:login.request. We also have
an image that will show when r:login.request is received and hide when r:login.response is received. The second part of the example is the mock
service. The mock service listens for
the r:login.request
service
request and responds with a r:login.response message after one second in order to simulate service
latency. The login form has no knowledge
of the service location; it simply responds to messages. This simple example demonstrates how an
entire RIA prototype can be built without writing any service code. This prototype would be 100% reusable, and it
has the added benefit of enabling developers to define the service contracts in
advance of service creation. The result
is that service creation is greatly simplified because service developers not
only have a fully functional prototype as a reference; they have a complete set
of service interfaces. Page 3 of 3 « previous page
BEA WEBLOGIC LATEST STORIES
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING NEWS FROM THE WIRES
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||