YOUR FEEDBACK
JavaOne 2008: Chris Keene's Prescription for Curing the Java Flu
darted wrote: You know I thought about this and the responses. I don't think...


2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


Using the J2EE View Helper Pattern in Your AIR Applications
I'm creating many small prototype applications using AIR and Flex 3

Digg This!

Marco Casario's "RIAvolutionize the Web" Blog

I'm currently creating many small applications using AIR and Flex 3. Most of them are prototypes with the purposes of showing AIR features and the quantity of code is small (600 lines at most). In this context it does not make much sense to use a framework or architecture such as Cairngorm or PureMVC or Defraga. So that I'm using a lot what in JSP is called the View Helper pattern.

The view components of your  AIR and Flex   applications, that will only contain the controls that define the user interface of the application,  will use a simple View Helper, consisting in an ActionScript class, to encapsulate business logic in a helper instead of a view, making our application more modular by facilitating component re-use.

A view contains formatting code, delegating its processing responsibilities to its helper classes, implemented as an Actionscript class. Helpers also store the view's intermediate data model and serve as business data adapters.

View  helpers has the following advantages:

  • improve the separation between the presentation and the business data actinga as intermediaries between the two
  • most of the code contained in a view components is merely mxml code
  • the code within the view components are more readable and a designer can browse and edit it to change the visual aspects of the application in an easy way
  • it can cache lookup tables for the application

To invoke a view helper you can simply

<h:UploadHelper id="uploadHelper" xmlns:h="com.comtaste.proto.controls.*" />

and the view helper UploadHelper class is an ActionScript class where you'll  encapsulate the business logic of view component :

package com.casario.proto.controls
{
import flash.events.Event;
import flash.events.IOErrorEvent;
import mx.controls.Alert;

public class MainHelper
{

protected var URLString:URLRequest =
            new URLRequest("http://www.domain.com/file.jsp");

[Bindable]
private var statusStr:String = new String("");


public function MainHelper()
{
super();

}


}
}

If you want to have more details and ivestigate on this pattern you can visit the View Helper  Design Pattern of J2EE.

About Marco Casario
Marco Casario is CEO of Comtaste, a company devoted to develop Rich Internet Applications on the Web and for mobile devices. He collaborates intensively with Adobe Italy as a speaker at conferences and as a consultant for Flash, Flex, and Flash Lite. Learn more about Marco Casario at his blog http://casario.blogs.com.

LATEST JAVA STORIES & POSTS
JavaOne 2008: Sun Adds Comprehensive Video Capabilities to JavaFX
Sun Microsystems announced it has entered into a multi-year agreement with On2 Technologies to add comprehensive video capabilities, using On2 Technologies TrueMotion video codecs, to Sun's JavaFX, a family of products for creating Rich Internet Applications (RIAs) with immersive
A Lightweight Approach to SOA and BPM in Java Using jBPM
SOA is mostly associated to technologies such as BPEL, SCA and Web Services. But does SOA really imply these technologies? In this session we will show how you can use the service oriented approach while staying inside the Java world. jBPM is a powerful lightweight framework that
JavaOne Archives - Dvorak Comments on AMD Intel Lawsuit on SYS-CON.TV
Conference in San Francisco. Dvorak held forth on a number of topics, including the new AMD/Intel lawsuit, the viability of Java and Sun, the value of (or lack thereof) of corporate PR, and whether or not a new book about Silicon Valley is really worth reading.
JavaOne 2008: Sun Talks Up its Late-to-the-Party AIR-Silverlight Rival
At Java One this week Sun has been selling its year -old-but-still-upcoming - and definitely late-to-the-party - Adobe AIR- and Microsoft Silverlight-competitive JavaFX Rich Client environment as a potential revenue-generator capable of putting ads on mobile applications and JavaF
Case Study: Java and the Mac
This is the story of a Mac application developer (okay - it's about two of them) who set out on a quest to find an application development tool based on Java so his boss would let him develop on the Mac platform, which he loved. There was only one catch - he had to find a tool th
JavaOne 2008: A Day One Report From the Sessions
My first technical session was about Java SE presented by Danny Coward from Sun. It was about the current situation of Java SE 6 and the roadmap to Java SE 7. The talk started with a few encouraging stats. For example, Java's performance increased 220% between Java SE 5.0_04 and
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING JAVA NEWS
Rev-Trac by Revelation Software Concepts Provides Automatic Mixed Platform Capabilities in Support of CTS+
Revelation Software Concepts Pty Ltd (RSC), an SAP(R) software partner, today announced that