Ryan Campbell Flex/Flash Developer Blog

16Mar/0712

MySQL access in Adobe Flex

Over the last few days I've been writing a shared library to connect directly to MySQL in ActionScript (a great way to learn the Socket and ByteArray classes ha). The code is now compiling without any errors or warnings but still needs a lot of testing. Over the weekend I'll make sure everything works correctly and also make it more Flex-friendly. I think it would be pretty cool to be able to query the db directly from ActionScript and have the results bindable to a DataGrid.

Although connecting directly to MySQL from Flash probably isn't the best idea for most applications, I'm mainly doing this for the learning experience. My plans are the following:

1. Complete the ActionScript MySQL Client
2. Modify/abstract the code to allow other database drivers (JDBC, ODBC, DBI, PDO-ish style)
3. Code a simple object-to-relational mapping framework (Similar to ActiveRecord)
4. Build a database administration app using the Flex framework

I'll keep everyone updated on my progress and I'll release the code as it is completed. I hope to hear anyones comments on similar ideas.

Filed under: Flex, MySQL 12 Comments
12Mar/072

Bypassing Web 2.0 to Adobe Flex

Last month I stumbled upon a technology that has revived the original motivation I use to have when developing software. For the majority of my career I have focused on building web based data driven applications. Each project I pushed the limits of HTML further, especially once AJAX came along. Although I've always been excited with the end result, it's still just a web page and I'm starting to get the feeling the browser just wasn't meant to serve applications. I think the browser has evolved quite a bit since originally introduced with CSS, JavaScript, DHTML but I also think HTML has reached its limits.

There is so much hype around AJAX because we're all amazed at what new things we can make the browser do, things that it originally wasn't meant to do. AJAX is simple, pulling data from the server after the page has loaded, but it's a hack and when dealing with all the cross-browser issues it feels like even more of a hack. Yet everyone uses it though because hack or not, it works and we could no longer imagine the web without it. I've actually started to feel like if I don't use it I am stuck in the old web, while everyone else is steps ahead in their fancy AJAX enabled web.

There will always be a place for HTML and it has served us well but for web applications I have now found a much better solution called Adobe Flex. It's a framework built on top of Flash 9 that from the beginning was developed specifically for building Rich Internet applications. Instead of steps ahead, I now feel leaps ahead of the AJAX world. No longer am I using JavaScript hacks, with Flex communicating with web services and even pushing data from the server is built in.

Server communication, although the biggest hype currently in the HTML/AJAX world, is only a small part of Adobe Flex. When developing HTML based applications I spent more time designing the pages and debugging JavaScript then I did writing the actually server-side back-end. With Flex there are no cross-browser issues to worry about and with 100 or so built in components it feels a lot more application developer friendly. If I want a data grid, I don't create an html table with the first row the labels and each other row the data, I use a Flex DataGrid component and assign a data provider to it.

Adobe Flex has allowed me to develop more interactive, user friendly, better looking applications easier and faster then ever before and with Flash as the back-end, it makes things possible that HTML isn't meant to do or will simply never be able to do. When picking tools for future web development, why not choose technologies that are built from the ground up to be full solutions and not just some quick fix buzzwords that only give us a taste of what the web should have been long ago.

Filed under: Flex 2 Comments
   
Ryan Campbell


follow bobjim at http://twitter.com

Recent Posts

Categories

Archives