When displaying data whose structure is not known, Flex does a good job when the records are given in a Array of objects. It introspects the objects and renders them in a decent way. It is good for displaying data from adhoc sql queries. When the data is in XML form the datagrid needed the columns to be defined upfront. Below is a small piece of code which introspects the first record and makes it possible.
private function render(detailXml:XML):void
{
if (detailXml != null)
{
var recordL:XMLListCollection = new XMLListCollection(detailXml.children());
if (recordL.length > 0)
{
var dg:DataGrid = new DataGrid();
dg.percentHeight = 100;
dg.percentWidth = 100;
dg.columns = this.createColumns(recordL.getItemAt(0) as XML);
dg.dataProvider = recordL;
this.addChild(dg);
}
}
}
private function createColumns(recordXml:XML):Array
{
var colL:Array = new Array();
for each (var eXml:XML in recordXml.elements())
{
var colName:String = eXml.localName();
colL.push(this.createColumn(colName));
}
return colL;
}
private function createColumn(field:String):DataGridColumn
{
var column:DataGridColumn = new DataGridColumn();
column.dataField = field;
column.headerText = field;
column.headerWordWrap = true;
column.wordWrap = true;
return column;
}
We have switched to an EBS deployment to make sure our databases are always backed up and can start a new EC2 instance very quickly from the EBS instance if needed. The first day into the switch, some transactions started performing poorly - from under 1 second to 20 seconds. When we compared the timings from the previous logs almost all transactions had a dip in performance from about double to 20 times.
Have been coding in Flex for about 2 years now. It is not a perfect tool but would say one of the best to deliver browser based rich UIs - no browser quirks to deal with and very productive. The real killer is the size of the application download, can run into MBs if all the source is compiled into one big application. Modules are good to break up into smaller chunks. But still the base application still comes to 300K with just the framework code. And then there is the issue of Singleton classes not really singletons across modules. So we end up including all such classes into the main application. Compiling with RSLs has got even the initial application size from 300K to about 100K, pretty the size of a mid-size module. So that's another option to work with.
I did read about this a while back when the challenges using EC2 was how not lose a database in case of a machine failure. Luckily it never happened and forgot all about EBS, the persistent disk for Amazon EC2. We went live with a new customer over the weekend and EBS came up all over again for data backup. Quite simple to use it.
Sending files through ftp is a piece of cake, or so I thought with all the commons net libraries around. I had to spend a few hours trying with apache commons net library and finally did it through sun.net.ftp.FtpClient. Below is the full code for anyone who needs it, without all the log messages.
bis = new BufferedInputStream(theFile,1000000);
byte buffer[] = new byte[1000000];
int i;
while ((i = bis.read(buffer)) != -1)
{
bos.write(buffer,0,i);
}
}
Adobe has launched hosted software toolkit (can't think of a better name) to build collaborative applications. You can check it out here at http://labs.adobe.com/technologies/afcs/. Some interesting features which are business agnostic -
An interesting trend in software development - it is becoming similar to the hardware assembly line - like the way we order a Dell computer. It will be interesting to see how easy and seamless integrating the above stuff into an application will be. Add other services from acrobat.com and it is a decent business toolset.
Interesting aspect to tackle after putting applications on EC2 in a live production environment. Our first customer has been live for over 1 year on EC2 and never been down for a single time. We didn't have to reboot the linux server though we had to restart our java processes for upgrades. Touchwood. Database incremental backups happen every minute to S3 and a daily back up at night. This is mostly an enterprise app, so not very stringent requirements on real time failover. Shortly we are going live with a new retail customer facing application - a 24 x 7 uptime requirement. Scalability is not much of an issue as our server is still operating under 65MB with response times under 50ms most of the time. Failover is a key aspect for us - passive or active, active being the preferred option.
Ant (http://ant/.apache.org) is embodies simplicity, extensibility and never in your way software. A lot of developer tasks can be automated with this tool. For quite some time we used it to just build a WAR file and deploy it Tomcat on our desktop machines. Deployment to server used to be a one hour task. Build with the server configuration files, ftp to server, extract static stuff to apache, re-deploy the database and recycle the server.
In a traditional server centric architecture UI is built on the server via php scripts, jsp or asp. So the UI is built and all that html travels back to the browser over the network. Ajax reduces this traffic by updating portions of pages on the browser. CDN benefits these architectures in 2 ways:
Had been checking out Amazon's CDN solution - CloudFront for one of our solutions. Amazingly easy to setup and run. Check out the product page at http://aws.amazon.com/cloudfront/.Very simple to get up and running:

do u guys have any bandwith for taking on a new project- flex app backend/s3/ec2 devcontact me at sundeep.patel@gmail.com read more
on Displaying XML records in Adobe Flex Datagrid