YOUR FEEDBACK
Werner Keil wrote: Java 6 update 10. If I'd be running Apple, I'd probably really drop dead...


2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
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
MXDJ TOP LINKS YOU MUST CLICK ON !


Ask the Expert
Basics of Flex explained

Andrew Trice, co-author of Flex 2 articles on Adobe's Developer Center, maintains a blog at http://www.cynergysystems.com/blogs/page/andrewtrice in which he helps orient newbies and experts alike about Flex. Web Developer's & Designer's Journal is pleased here to bring a sampler of some of his more recent shared insights.

Getters and Setters vs. Public Properties in Flex
I've been asked several times, why would you use get/set functions instead of public variables in your Flex components and classes? Well, there are some great things you can do with getters and setters that you can't do with public variables. On the other hand, there are cases where public variables work better. When using these functions and/or public variables, the code for the caller will be the same:

mycomponent.myValue = 1;

First, let's look at public variables...

[Bindable]
public var myValue : Number

It is better to use public variables when there are no additional actions that need to take place when the value has been changed. If you change the value of "myValue", the bindings will update and everything will be handled accordingly. The value will change, and anything bound to that value will change. In this case, there is no need to use getter/setter methods.

Now, on to getters and setters...

[Bindable(event="myValueUpdated")]
public function set myValue (value:Number):void
{
      _myValue = value;
      dispatchEvent( new FlexEvent( "myValueUpdated" ) );
}

public function get myValue ():Number
{
      return _myValue ;
}

private var _myValue : Number;

First I'll explain the [Bindable(event="myValueUpdated")] statement: This indicates that the data binding to the getter's value should be updated when the event of type "myValueUpdated" is dispatched. You'll notice that when the value is set, this event is dispatched, which would notify any components that are bound to this value.

Now, the rest... The code that I showed above doesn't have any benefits over the public property; it functions in exactly the same way, but requires more code. The benefit of getter and setter functions is that they enable sequential code execution when the value is changed. You can create your components so that specific functions are executed any time that the value is accessed using get and/or set functions.

Here's an example:

[Bindable(event="myValueUpdated")]
public function set myValue (value:Number):void
{
      _myValue = value;
      numSets ++;
      myFunction();
      dispatchEvent( new FlexEvent( "myValueUpdated" ) );
}

public function get myValue ():Number
{
      numGets ++;
      myOtherFunction();
      return _myValue ;
}

private var _myValue : Number;
private var numGets : Number = 0;
private var numSets : Number = 0;

In this example, every time the value is set, the numSets Number is incremented, and the myFunction() function is executed. Likewise, every time the value is accessed using the "get" method, the numGets Number is incremented, and the myOtherFunction() function is executed. There is no limit to what kind of code you can execute here. You can have it dispatch custom events, change styles, create new components, etc. This turns out to be very handy when creating custom Flex components.


About Andrew Trice
Andrew Trice is a consultant with Cynergy Systems in Washington, DC, where he specializes in development of Flex-based Rich Internet Applications. Andrew has over 5 years of proven experience in the RIA industry, including application design and development using Flex, Flash, ColdFusion, J2EE and .NET architectures.

YOUR FEEDBACK
JDJ News Desk wrote: This presentation will demonstrate how to quickly and easily add AJAX capabilities to standard HTML forms using the Dojo toolkit. This talk is for developers who want to enpower their forms quickly with a minimal learning curve. We'll cover client-side validations, validations on the server without a page refresh, and adding specialized Dojo widgets to forms for selecting dates and providing a rich text editor. Relevent features of Dojo .4 will also be discussed. Students will walk away with practical examples for adding AJAX capabilities to their forms.
AJAXWorld News Desk wrote: This presentation will demonstrate how to quickly and easily add AJAX capabilities to standard HTML forms using the Dojo toolkit. This talk is for developers who want to enpower their forms quickly with a minimal learning curve. We'll cover client-side validations, validations on the server without a page refresh, and adding specialized Dojo widgets to forms for selecting dates and providing a rich text editor. Relevent features of Dojo .4 will also be discussed. Students will walk away with practical examples for adding AJAX capabilities to their forms.
LATEST FLEX STORIES & POSTS
It's simple and minimalistic, has a small memory footprint and is easy on the CPU. Flash player works fine on my Windows XP box. JavaFX developers should like it too.
Alfresco Software announced that Adobe has implemented Alfresco’s document sharing and collaboration capabilities as part of the file sharing features in Acrobat.com. Adobe chose Alfresco as its content repository for its clustered high-availability, security, and highly capable tec...
Enterprises are enthusiastically embracing the shift from traditional client/server computing to SaaS. Inspired by customers who have embraced the Web, developers are using RIA tools to create innovative new on-demand business applications. One important factor in the shift from tradit...
Adobe Flex and Flash are the ideal technology for Rich Internet Applications because you can build those applications with reusable components that are Loosely Coupled. In his session, learn how you can create an On-Demand Authoring Environment for creating Rich Internet Applications b...
Director of Ribbit's Developer Platform, Chuck Freedman, will explore an evolution in web communication. With the growing demand of RIA and voice-over-the-web solutions, developers finally have a full suite of communication APIs to add to Flash. Coding with Ribbit, Freedman will demons...
Rich Internet Applications offer the potential to fundamentally change the user experience and in doing so, yield significant business benefits. The theme of this October's AJAXWorld Conference & Expo 2008 West is 'Beyond AJAX to the RIA Era' and the Call for Papers, which is still ope...
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