Flex
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?
Dec. 25, 2007 01:30 PM
Digg This!
Page 2 of 2
« previous page
Importantly, we’ll link this library to the main project as a Resource Shared Library (RSL), which means that the objects from patches,swc will not be merged into the code of the main application, but will be loaded during the run time. Add the compiler option -debug=false to your library project to avoid these annoying Flash Player’s messages asking where the debugger for this RSL is located.
Now go to the build path of the main Flex project and add patches.swc to the top of the list. Select the RSL linkage type as shown below (TestPatch there is the name of the main Flex project).
Go again to the properties of your main Flex project and add the library patches project in the list of your project’s references.
Run your main project – you should not see any differences because patches.swc does not contain any useful code yet.
Then, copy one of your classes from the main application it to the patches library project, modify it there and rebuild the patches.swc. Now we have two versions of this class – the new one in the patches.swc and the old one in the main application.
Re-run the main application. You’ll see that the new version of the modified class is being used. The class loader picked the new version since patches.swc is located at the top of the classpath of your application. That’s all there is to it.
Every time you need to make minor changes in your production application, just put them in patches.swc and upload it to the production machine.
Page 2 of 2
« previous page
About Yakov FainYakov Fain is a managing principal of Farata Systems, consulting, training and product company. He has authored several Java books, dozens of technical articles. SYS-CON Books released his latest co-authored book , "Rich Internet Applications with Adobe Flex and Java: Secrets of the Masters" in Spring 2007. Sun Microsystems has nominated and awarded Yakov with the title Java Champion. He leads the Princeton Java Users Group. Yakov teaches Java and Flex 2 part time at New York University. He is an Adobe Certified Flex Instructor and an Editor-in-Chief of Flex Developers Journal.