Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flex project architecture?

What's the best way to organize functionality modules in a flex project? I saw some people put all modules in one view stack ,and so the application interface is only load once, but when the application get larger, the whole compiled swf would be very big. If we put swfs in different pages, we pass request parameters through HTTP request, we lost the benefits from flex RPC services, slow loading, and we can't see any superior comparing to php,asp,jsp... what's the best practice to organize front end architecture?

like image 643
Sawyer Avatar asked Apr 19 '10 12:04

Sawyer


2 Answers

This is a tricky question and depends on your application. I've been struggling with this for quite a while, so I'm interested to see other approaches as well.

In terms of architecture I usually create a "frame" application that takes care of loading modules and usually also displaying them. This frame usually also handles concerns like authentication. Whether it's a viewstack or a different solution is not that important. But what you usually don't want is everything packaged into one giant SWF because the Flash player will need to load the whole thing before actually displaying anything.

A related problem that usually comes up when architecting applications is how to handle "navigation" within the resulting application. I usually end up building some kind of navigation event that gets handled partly by the frame (loading modules) and/or the actual modules. But again, this is just my understanding, I'm curious to hear other approaches.

like image 197
ilikeorangutans Avatar answered Nov 05 '22 07:11

ilikeorangutans


The modules are loaded on demand. So the size of the parent swf should not depend on the number of modules. However the size of the used memory will increase when loading modules - if this is a problem you can try to unload them (not an easy task, but you can do it). So I would keep the view stack approach.

like image 36
Cornel Creanga Avatar answered Nov 05 '22 07:11

Cornel Creanga