Douglas,

 

I agree with embedding the server call in the component if it is a one-off
or a low use item. It follows the 'build the simplest thing that will work'
philosophy.

 

If it is a higher use component, then I'd at least add some initialization
parameters to the component so that things could be changed. For example, in
the future you might want to change the service the component is making its
server calls to or have the component open a different dialog than the
default. All of this can easily be added over time as needed without
changing the core default behavior. So managers like Mike mentioned can
always be added later with default behavior encapsulated within the
component.

 

--Steve

 

  _____  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Douglas Knudsen
Sent: Wednesday, March 14, 2007 1:12 PM
To: [email protected]
Subject: Re: [AFFUG Discuss] Components, Objects, Web Services, Oh My

 

I think Clarke is speaking to a single 'one off' component though.  I
recently built one like this.  Its sole function is to provide a Text field
with a search icon, clicking the search icon gives the user a search dialog
to search for a employee in our people soft database.  I wanted this one
piece to be plug-n-playable to any tool.  So, I build the server calls right
inside it, no MVC, framework, patterns, etc... its just a single mxml file.
Now any developer can drop it in and get to work. 

DK

On 3/14/07, Mike Britton <[EMAIL PROTECTED]> wrote:

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.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
-------------------------------------------------------------






-- 
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it? 
------------------------------------------------------------- 
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 FusionLink <http://www.fusionlink.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