Enhace, Extend, Transform

Web 2.0 Magazine

Subscribe to Web 2.0 Magazine: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get Web 2.0 Magazine: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Web 2.0 Authors: Xenia von Wedel, Harry Trott, Larry Alton, Elizabeth White, JP Morgenthal

Related Topics: Web 2.0 Magazine, Java Developer Magazine

Web 2.0 : Article

How Do You Deploy Patches in Your Rich Internet Application?

OK, your Flex application is already deployed in production. How are you planning to deploy patches to your code?

OK, your Flex application is already deployed in production. How are you planning to deploy patches to your code? I mean bug fixes or enhancements to specific MXML components or ActionScript classes? Of course, you can recompile the entire application with hundreds of classes just to deploy a new version of the class MyGreatCreation.as. Let’s see if there is a way to deploy just MyGreatCreation leaving the rest of your application intact.

In Java world, the solution to this issue is pretty simple. A typical Java application consists of a number of .jar files (think libraries or swc) and there is a concept of a class path. If a program needs to use a class MyGreatCreation, the Java class loader tries to find it based on the classes or jars listed in the classpath. If there is more than one version of this class in the path, the class loader will grab the first one. This greatly simplifies deploying any patches in Java production applications. Just make changes to your class and place it in the jar that is listed first in the classpath. Then deploy just this jar in production, and the loader will be happy to pick up the brand new version of MyGreatCreation.

Luckily, we can use the same techniques in Flex, which also has concepts of classpath, class loaders and libraries.

Go to the Properties window of your Flex Builder project and check the build path of your application. At a minimum, you’ll find there a number of libraries (compiled swc files) that represent the Flex framework itself. The chances are that you’ve added more swc’s there that contain your application-specific code.

In any event, create a new Flex Library project called patches or something of this nature.  To be able to compile this project into an swc, add an empty ActionScript class there. We’ll be using the patches.swc as a first item in the build path of our main project.

In 2007 AJAXWorld Is Sponsored by More Than 70 Leading Rich Web Technology Companies
AJAXWorld Conference & Expo this year was sponsored by the world's leading rich web technology providers including: 3Tera, Addison-Wesley, Adobe, Apress, Backbase, Bindows, Conference Guru, Cynergy Systems, Dynamic Toolbar, Extension Media, Farata Systems, Flash Goddess, FrogLogic, GoingToMeet.com, Google, Helmi Technologies, IBM, ICEsoft, ILOG, IT Mill, Ittoolbox, JackBe, JetBrains, Kaazing, Krugle, Laszlo Systems, Lightstreamer, Manning Publications, Methods & Tools, Microsoft, Nexaweb, OpenSpot, OpSource, Oracle, Parasoft, Passport Corporation, PushToTest, Quasar Technologies, Rearden Commerce, Servoy, SmartClient / Isomorphic Software, SnapLogic, Sun Microsystems, TechTracker Media, Tele Atlas, The Thomson Corporation, ThinWire, TIBCO Software, TileStack, Universal Mind, Vertex Logic, Web Spiders, and Webtide.

More Stories By Yakov Fain

Yakov Fain is a Java Champion and a co-founder of the IT consultancy Farata Systems and the product company SuranceBay. He wrote a thousand blogs (http://yakovfain.com) and several books about software development. Yakov authored and co-authored such books as "Angular 2 Development with TypeScript", "Java 24-Hour Trainer", and "Enterprise Web Development". His Twitter tag is @yfain

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.