Skip navigation
Currently Being Moderated

Communication between modules using cairngorm

May 29, 2011 8:17 AM

Hi all,

 

I'm looking for the best practice of communication between modules using cairngorm.

I read the document which offers three ways (http://livedocs.adobe.com/flex/3/html/help.html?content=modular_7.html):

1. Using query string

2. Using interfaces   

3. Accessing through parent

 

However, I am using componentized approach (http://sourceforge.net/adobe/cairngorm/wiki/ApplyingthePresentationMod el-ComponentizedvsHierarchical/)

for the presentation model. Meaning I want to use presentor to handle all data passing between modules, and have a presentor which is a part of a module to handle the data passing in the different views of the module.

 

I am getting a bit confused with the structure when building the app. The main application component is being injected with all the modules and the application presentor.

 

Do you have a suggestion of a correct structure?

 

Thanks alot!


Assaf

 
Replies
  • Currently Being Moderated
    May 30, 2011 4:53 AM   in reply to RedBall23

    interface is the best choice

     

    -> Akshar Kaul <-

     
    |
    Mark as:
  • Currently Being Moderated
    May 30, 2011 6:06 AM   in reply to RedBall23

    because when you are using interfaces you can check whether the component is

    type of that interface. if it is then you can simply type cast it and call

    any method you have defined in interface knowing that it wont crash at

    runtime.

    but in accessing through parent you dont have this control... your

    application can crash at runtime if you call some non existing function.

     

    query string a bit too cumbersome to do and if you change something in the

    component you have to make changes in every place.

     

    -> Akshar Kaul <-

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points