Roundarch Partners with Brightcove to Create ...

Aman Datta, vice president at Roundarch, explains how our partnership with Brightcove allows us to create scalable, flexible and ...

Roundarch Sponsors Boston Interactions Fifth ...

Roundarch proudly co-sponsored the Boston Interactions Fifth Annual Winter Party this past Tuesday evening (1.24) in Cambridge, MA.  Boston ...

Flex and Its Future as an Apache Project

Leaders in the Flex community recently gathered at Adobe’s San Francisco headquarters this week. I’ve covered my thoughts to the ...

Virtualization: A Dream within a Dream

CIOs have a tough problem to solve.  It is typically their responsibility to maintain all of the applications within their network, safely and ...

Flex – The Good, The Bad, and The Future

Over the past week the Flash and Flex community have been on a roller coaster ride with announcements by Adobe regarding the Flash platform.  As ...

Attending SharePoint Conference 2011

I recently attended the SharePoint 2011 conference held in Anaheim, CA.  The event hosted about 7,500 attendees with broad ranging backgrounds.  ...

Roundarch Hosts IxDA Chicago Chapter October ...

Roundarch is proud to have hosted a special event for the Interaction Design Association’s (IxDA) Chicago chapter this past Wednesday. IxDA ...

Exploring Dark Patterns in User Experience at Web ...

Last week I attended Web 2.0 Expo in New York to give a talk about dark patterns in user experience. This talk was somewhat the sequel of a talk I ...

The Importance of Being a Mentor

“Be the change you want to see in the world” a quote by Mahatma Gandhi stands as a focal point on one of the walls at the iMentor.org ...

KCRW Music Mine iPad App Released- Introducing a ...

Today we are happy to announce the release of Music Mine, a free iPad media discovery application designed by the team at Roundarch for KCRW, ...

Roundarch Participates in a Panel About the ...

Whether Adobe represents an aging dinosaur in an online world that is quickly passing them by or a force still to be reckoned with in a battle of ...

Roundarch and Bloomberg Sports Launch In-Season ...

Spurred by the success of the Front Office suite of fantasy baseball tools for the 2011 season, Roundarch and Bloomberg Sports have teamed up to ...

Golf Business Explains How Roundarch and ClubCorp ...

Roundarch has partnered with ClubCorp, the world leader in private clubs with 150 across the country, to create an entirely new digital experience ...

Roundarch Updates Waters iPad App with Game ...

Quickly following the success of the first Waters iPad application, the second version of the app is now available in the app store.  The first ...

Roundarch Addresses Common Concerns Regarding ...

It is no secret in the Federal Government that focusing on user experience is not a major concern within government ...

, , ,

Technical Blog Entry – Get Fewer Warnings With Adobe Flex

By

The Problem:

When using the square bracket notation to de-reference a property of an object within the mxml, you receive an invalid warning as in the following example. It stops you from noticing warnings that actually mean something, I’ll call it “warning blindness.”

First seeing these warnings a developer might think they need to add the [Bindable] tag to the object. Doing so will eliminate one of the errors, but will add to the compilation time and won’t really add any value unless the value of the object changes and it needs to actually dispatch events for binding updates. Furthermore, the developer would still have the warning regarding not using the square bracket operators within a binding tag. If the user wants to receive binding updates or is less concerned about the extra overhead added by using the [Bindable] tag they may do so. This is a useful warning; it informs you of something that will actually make a difference come run time. The other warning is not taking into account the context of the square brackets, and falsely “believes” that the type of the variable using the square brackets is an Array or an ArrayCollection rather than an object, and is thus informing you of your possible error. This isn’t a problem if you have 1 or 2 of these, but say you have 30. Now it starts to clog up your warnings box and you start ignoring (or not seeing) things that actually matter. This is especially a problem in Flex Builder because warnings tend to not clear properly when doing an incremental build, so many times it will replicate the warnings (clean build in my experience has always worked to clear the warnings and give me the proper list, but clean building means building things that didn’t change and therefore wasted compilation time).

The Solution:


Since the function call in the binding only references the object changes to the underlying properties it will not cause the bound value to be updated, rather the entire object must change as in the following example:

If this is an issue across an entire application, the method can easily be plugged into a static utility class and used throughout the application. Also be mindful in the above example the curly braces in the click event of the button signify a new object not a binding.

package utils
{
public class ObPropUtil
{
public static function obProp(object:Object, prop:String):Object
{
return object[prop];
}
}
}

And then easily used anywhere with ObPropUtil.obProp(someObject, SOME_PROPERTY) in place of someObject[SOME_PROPERTY]

If you aren’t using constants, you can generally chain along the dot operator without a problem (you cannot use constants in place of a literal variable using the dot operator chaining, and therefore are forced into using the square bracket operator).

Read More | | Comments (0) | TrackBacks |      Digg!   Delicious     
*name

*e-mail

web site

leave a comment


 

Adobe   Adobe Flex   android   Apple   applications   Avis   Bloomberg   Bloomberg Sports   Chicago   Cloud Computing   Conferences   Decision Maker   Design   FAST   Flash   Flex   google   html5   Innovation   iPad   iPhone   Merapi   Microsoft   Mobile   New Meadowlands Stadium   New York Jets   NFL   RIA   Roundarch Labs   SEO   Silverlight   social media   StrataLogica   SXSW   sxsw09   sxswi   Technology   Tesla   Touchscreen   twitter   usability   USAF   User Experience   UX   Wilco  

  • 2012 (2)
  • 2011 (37)
  • 2010 (74)
  • 2009 (50)
  • 2008 (15)

© Roundarch, Inc. 2010 | Privacy Policy