Grey Line

Holidays are officially over, and it is good time to start blogging again. I will try to put few little known tricks that might be considered a bit “unorthodox”. DISCLAIMER: they are not standard techniques used at Farata Systems. I would not recommend them to a client without a full disclosure of the risks and chances of being “unsupported” in the future. The idea is to make it in discussion on the best practices or at least acceptable practices.

Flex 2.0.1. has introduced modules. The idea is to partition your application into set of independent pieces that can be streamed on demand or in background. While the goal is noble, implementation can and should be imroved for developers to benefit. Module is pretty much independent swf that is very much “black box” to the rest of the application. In order to communicate between module and application you can define interface and place it in the library shared by application and module. Module has to implement the interface and application will call methods on it. That model presents challenges when you apply it as the only solution to the large application partitioning/optimization.

Here is a brief history note – we were advocating and implementing modules (in a very crude way) since the beginning of the last year. It helped with large applications quite a bit – but it’s applicability was around 20% of the cases. I will start with going through deployment cases and my take on the applicable cases.
OK, bag of tricks # 1 – make your application load fast and stay small.

Here are your choices :

1. Do nothing, use defaults – your application will be produced as a single swf file -sizing 200KB to possibly few MB – but it minimum size for the total download to “clean” machine. Any change to the application invalidates browser cash and causes reload. Good for applications that are used seldom or by wide audience.
2. You use Flex framework libraries as RSLs – you are getting minimum size of framework download of 1.3MB but your application is really small now and changes are loaded instantaneously. Excellent for intranet and often used/often changing applications for heavy duty users

3. The same as #2, but you want to bite a bullet and optimize framework load and make it usable on your domain. You read James Ward’s blog on patch to preloader (http://www.jamesward.org/wordpress/2006/11/27/howto-reduce-the-size-of-your-flex-app/) and build your own version of it. Make sure you strip debugging stuff for another 30% of the size benefit/startup messages removal.

Hopefully, Adobe will come with deployment libraries hosted on their site, plugged in the player update mechanics for security and allowing fallback to the client’s sites -  with  Adobe or VeriSign  type of certificates  as it is one of the best ways  to trim your applications – with no work for you.
4. Modules as implemented by default shine if you have a rich (heavy) piece of functionality that is independent from the rest – the very same way you could of break you application into the larger number of small ones. Certain classes of applications and widgets would benefit from it. You,as a developer, will suffer – working with black box is not easy. Interfaces sound like good idea but interferes with development process by requiring you to update 3 things at once. And if you have “shared” interface for few modules – you need to update everyone.
5. You want a library / module hybrid. You want to be able to load it on demand, you also want an option to code against it like in a regular library for type checking and better integration. That one is very easy to implement – just requires 2 compilations (by compc for SWC used by compiler and MXML for module) and trick on deployment similar to James’s- but greatly enhances flexibility/options on modules development and deployment. I will this put template in the flex2ant plugin that automates the process.

6. Finally, you might want to use “resources” based approach for the application. Essentially, resources are a way for developers to separate algorithms (code) from UI/data implementation the same way designers separate design from CSS. Let me give you business example of that and then we will go back to implementation details. Let us say you have DataGrid that will be used to browse something – it can be employees, customers or products. Functions are very much the same – you can scroll print, sort, filter, drill down – but list of columns and data providers are different. However, if you plug in new array of columns and change dataProvider, the datagrid can show different data set.

These specifics can be separated in different modules (one for employees with related itemrenderers and functions, one for customers and one for products). The datagrid stays in the application, load these modules on demand when user switches the view and import the values in. It just needs the module name and the name of datagrid class in the module. Unlike approach with pure modules you implement functionality once in the application and change UI/data with modules. Canonical modules force you to implement the same functionality in each module or get really creative in making that functionality shareable.
Some other examples that can use resources are data aware controls like treeview, combobox, checkbox, radiobuttongroup, anything. As you start using it it becomes way for you to easily manage development process and separate the work for people with different skill levels.
I will be posting some samples on library/module hybrid and resources shortly – meanwhile let me know if I missed other major deployment scenarios.

Sincerely,

Anatole Tartakovsky

Bonus section: a while back I had a post (http://flexblog.faratasystems.com/?p=88) on how to use Ted Patricks preloader (he had few “splash screens” models) in real applications – like give the user simple login screen to keep him busy while the app is being loaded and initialized – and carry the entered information back to the app/ hold displaying application till logging is complete.

1 Comment

  1. Patrick said,

    March 7, 2007 @ 6:06 am

    I’ seen your article on:
    http://flexblog.faratasystems.com/?p=147

    I hope you can help me or put some light on the subject. I know that you don’t
    have time to mess with someone’s coding but please… or you know someone who I
    should go to.

    I’ve spend loads of time trying to solve the problem. Googling doesn’t give any
    solutions, so it’s time for the experts :)

    I need application running on local machine (swf file on Desktop) to download a
    module from server and display it.

    So far I can download it, set the applicationDomain, but how to display it?

    Local app.:
    =======================================================

    =======================================================

    Remote app.:
    =======================================================

    =======================================================

    Help, please …


    Best regards,

RSS feed for comments on this post

canada online pharmacy propecia
free cialis
buy cialis without rx
cheap cialis
viagra quick delivery
levitra overnight shipping
best price cialis without perscription
hydrochlorothiazide cialis
50mg viagra
cialis discount prices
best price cialis
canada levitra
online viagra levitra cialis
cialis pills for sale
indian cialis
cialis free samples
when will viagra be generic?
buy cheap viagra online uk
order generic viagra canada
where can i get cialis
generic viagra online pharmacy
cheap online propecia
propecia from canada
best price for generic viagra
where buy viagra
cialis 5 mg
viagra off internet
alaska viagra doctors
buy viagra online without a prescription
viagra onlines
propecia sales canadian
cialis ottawa pharmacy
cheapest viagra online
online ordering propecia
buy cheap uk viagra
overnight viagra
viagra online buy
buy propecia 5mg
online order viagra overnight delivery
how to buy viagra in canada
propecia discount
cialis daily canada
canada propecia prescription
vardenafil:
cialis next day delivery
order viagra in canada
cialis free delivery
uk cialis sales
buying generic propecia
canada viagra
levitra without prescription
generic viagra australia
cheap cialis from india
buy generic cialis online
online presription for viagra
best viagra and popular in uk

real viagra without prescription
levitra online without prescription
liquid cialis for sale
buy generic cialis online from canada
viagra express delivery
soft gel viagra
buy cialis pill
canadian generic cialis
tablet viagra
100 mg cialis
buy cheapest cialis
propecia for sale online
overnight propecia
viagra price
get cialis online
buy cheap generic cialis
viagra replacement
viagra online in canada
order cialis from canada
prescription needed for cialis
menu:
50mg viagra
viagra for sale online in the uk
cialis canada on line
viagra mail order usa
cialis viagra
viagra 100 mg
cialis for less 20 mg
levitra viagra online
find cheap viagra online
online viagra au
online generic cialis 100 mg
online pharmacy propecia
pfizer viagra no prescription
buy propecia online cheap pharmacy
to buy viagra online
propecia
viagra doses
i want free viagra
buy real viagra online no prescription
viagra for woman
brand viagra professional
sildenafil viagra
cialis now
viagra for less
lowest price for viagra from canada
where to buy cialis cheap
viagra online in canada
canadian healthcare cialis
cialis kanada
cheapest levitra uk
cheapest viagra in uk
no prescription viagra canada
canadian pharmacy cialis no rx
cheapest prices on propecia
viagra samples
cheap discount cialis
viagra tablet weight
low price viagra
viagra canadian pharmacy support
cialis us drug stores
generic cialis next day delivery
viagra canada cheapest
buy propecia online
generic propecia canada
find cialis no prescription required
propecia cialis viagra
cialis strenght mg
lowest-price propecia costs us
discount cialis levitra viagra
buy viagra for women
real cialis online
drugstore best buy generic cialisbuy generic cialis
generic viagra canadian pharmacy
cialis testimonial
propecia generic
viagra how much
buy propecia no prescription
find viagra without prescription
buy generic cialis online
no rx viagra
cialis free delivery
viagra from uk
cheap canadian viagra
buy generic cialis
cheap cialis pills
levitra 10 mg without prescriptions
viagra pfizer canada
cheap viagra for sale
cheap cialis online canada
viagra echeck
cheap cialis online no prescription
propecia orders
cialis without prescription in canada
low cost canadian viagra
viagra/cialis sales
buy cialis without prescription
generic propecia for sale
cheap viagra canada
can i buy viagra in canada
nizagara viagra online
viagra mail order
www.cialis.com
viagra sales online
viagra in china
canadian pharmacy viagra cheap
ordering viagra online
cialis canadian cost
buy viagra online without prescription
viagra with no prescription in britain
find viagra no prescription required
cialis daily canada
cheap brand name cialis
vardenafil generic
buy propecia without a prescription
the best price of viagra
try cialis for free
order cialis in canada
usa cialis women
generic cialis sales
viagra sale
sale of viagra tablets
womens viagra no prescription
di scount 50 mg viagra
buy cialis online australia
cialis online australia
real viagra without a prescription
buy cheapest viagra online
cialis canadian online pharmacy
sale viagra
alternative for viagra
prescription for propecia
buying cheap cialis
viagra order
viagra com
purchase cialis next day delivery
online viagra levitra cialis
professional cialis online
combine cialis and levitra
prices for propecia
real viagra to buy
sildenafil
levitra for sale
cheap order prescription propecia