I usually don't put remoting calls in my MXML.  I'd set up an MVC to
handle the remote calls and bubble the results back up to your
component.  This way you could use the same architecture for other
components.

Defining callbacks in your MXML component's attributes:

<britton:MyManager someEvent="this.someHandler" />

Optionally (as seen above) you could create a Manager that would talk
to your Controller of choice.  This would be the class that sends
events back to your component.

If it gets more complicated than this, I'd use Cairngorm.  Sorry about
the brevity of this explanation, but right now I'm trying to make Cake
PHP and Flex play together :-)


hth,

Mike


On 3/14/07, Clarke Bishop <[EMAIL PROTECTED]> wrote:
In my main application, I've got an Accordion that contains three custom
components. At least two of the components need to talk back to the server.
The function of each component is totally independent -- They will be doing
different things and calling different web services.

Here's my question: Is it bad form or a bad idea to embed the web services
or remoting code in the components?

I know, Cairngorm fixes this, but my app is too simple to deal with all the
Cairngorm overhead.

I'm still struggling with thinking about how to encapsulate functionality
cleanly in Flex, so any pointers are much appreciated!

   Clarke





-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------





--
Mike
----------
http://www.mikebritton.com
http://www.mikenkim.com


-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------


Reply via email to