1

I we have been working for some years in a flex (cairgorn)+spring+blazeDataservice application using blazeDataservice to connect to the back end, now its getting kind of big and takes too much time too load, and people who use it, normally need it to use it regulary.

My country's internet bandwith is not getting better, actually it´s getting worse, so the app gets bigger and bandwith gets worse so loading it it's getting slower by the day.

I was wondering how could I get the client to be installed on peoples computers, I would be turning a flex online app into a desktop app WITHOUT REWRITING IT. I only need someone to point me in the right direction, i was thinking about 2 options:

1.- Can it be turned into adobe air ? is in´t adobe air desktop ?

2.- Maybe a flash that runs in peoples desktop ?

I need everything to work against the host spring backend just like it does today

Thank you very much!

Adnan
  • 25,882
  • 18
  • 81
  • 110
Ernest
  • 962
  • 3
  • 12
  • 28
  • 1
    Already answered: http://stackoverflow.com/questions/93359/can-i-generate-a-flex-web-and-air-desktop-app-from-the-same-source-code Answer by Marc Hughes is the best one IMO – RIAstar Jun 14 '11 at 14:20
  • 1
    BTW: without rewriting, this desktop app would still have to load everything. You'll still have to add some logic for local storage and synching with the server. – RIAstar Jun 14 '11 at 14:26
  • It sounds like you're feeling the effects of [technical debt](http://stackoverflow.com/questions/1258775/what-is-technical-debt). From what you've described, a rewrite is almost inevitable. The longer you wait, and the more features you add will only make this rewrite heavier. – elekwent Jun 15 '11 at 06:41

2 Answers2

3

Just to be clear:

If it is the size of the app (SWF) itself, rather than the queries being performed, an another alternative to speed things up, without building a Desktop (AIR) version, would be to use what Flex calls Modules.

Basically you would be breaking your app into smaller pieces that get loaded only as necessary.

If you do go the Desktop (AIR) route, you may also want to explore a local SQLite database that Syncs with your server only as needed, thus further reducing the internet connectivity issues.

This would of course add to your development time, but it seems like it might be a good bet given the situation you describe.

As for where to start, switching from a Web to a Desktop (AIR) app can be as simple as changing the main MXML tag from (in Flex 3) mx:Application to mx:WindowedApplication and launching your app.

UPDATE in response to follow up question:

Hard to say how much rewriting would be involved without knowing how your code is currently structured, but doubtful it would be a major rewrite.

As an experiment, I would suggest the following:

  1. Create a new Flex application.
  2. Create a new Module.
  3. Add some simple MXML and Actionscript to the Module.
  4. Add an instance of the Module to your Main view.
  5. Run/Compile.

What you should see is that you might as well have not wrapped it in a Module at all, from a functionality or coding perspective, but the Module will have been compiled into a separate SWF, and Flex will handle loading it as needed.

If that all works and makes sense, I would start breaking up pieces of your code into Modules and see if that begins to solve your problem.

dbgpyd
  • 332
  • 2
  • 10
  • Hello, yes the problem is the size of the SWF, however for breaking the app i would have to do some heavy rewrite, or im i mistaken ? if its so could you point me to some reading of this modules breaking ? About the Desktop (AIR) SQLite route, the program itself holds everything in memory and only goes to the server when need it, and it does needs to go to the server because there is another part of the application that hits the server and creates jstl/jsp pages online. I will try the tagg and read the bellow tutorial and post back – Ernest Jun 14 '11 at 18:37
2

Adobe AIR is the right way to go. It is essentially #2, and often you can pretty much just publish exactly what you have straight to AIR instead of the web, and it just works. Fancy!

Jordan
  • 31,971
  • 6
  • 56
  • 67
  • and this would be a download, then double click, then use app right ? wow! where should i start reading? – Ernest Jun 14 '11 at 14:08
  • @Ernest: Adobe has a few getting started articles: http://www.adobe.com/devnet/air/articles/getting_started_air_js.html and http://www.adobe.com/devnet/air/articles/getting_started_air_as.html – Jordan Jun 14 '11 at 15:35