Hi Omar, Remember that we're building OO systems in Flex here...
First off; you might consider having an ErrorViewHelper ... there's a good argument here for a view helper. Your "model" is an exception, but you want to manipulate that model to prepare it for the view, ie to change an exception into a user-readable error message displayed in a dialog. Perhaps you even have different icons to display in your error dialog depending on the exception thrown. So in this case, you might want to consider an ErrorViewHelper that is responsible for popping up an error dialog with an appropriate error message/icon depending upon the exception thrown. So yes .... perhaps a ViewHelper will work for you here, and I think it's a valid use-case for the pattern. But my earlier warning; remember you are building on OO system here. So you should think about what business objects you can extract that have utility for your application. I might think about creating an ErrorService class that sits outwith the Cairngorm framework and provides the utility that you require. Your command classes can then become clients of your ErrorService class, which can be separately unit-tested. Cairngorm is doing 80% of the heavy-lifting on most applications, and gives structure to your workflow. But, I'd really like to see developers continuing to take responsibility for application-specific business domain objects, rather than abdicating responsibility for where behavior resides, to a best-fit choice of command, business delegate or view helper. Make sense ? Steven PS. I hate class names ending in Manager or Service - it's just such an overused suffix that lacks ingenuity. ExceptionManager, ErrorService, ErrorManager .... aaargh. See if you can find a name that describes your particular problem's solution a little better than I can. :) -- Steven Webster Technical Director iteration::two [EMAIL PROTECTED] Office: +44 (0)131 338 6108 Mobile: +44 (0)7977 216 223 This e-mail and any associated attachments transmitted with it may contain confidential information and must not be copied, or disclosed, or used by anyone other than the intended recipient(s). If you are not the intended recipient(s) please destroy this e-mail, and any copies of it, immediately. Please also note that while software systems have been used to try to ensure that this e-mail has been swept for viruses, iteration::two do not accept responsibility for any damage or loss caused in respect of any viruses transmitted by the e-mail. Please ensure your own checks are carried out before any attachments are opened. -----Original Message----- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Omar Ramos Sent: 10 August 2005 20:42 To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Cairgorm command question. Thanks for your reply steven. Let me tell my case. I am checking a subdomain on the .NET side and if the subdomain is not available .net throws a DomainNotAvailable event with a error code. Now in flash if the error code is DomainNotAvailable then I show the user some status text on the view. The code that determinates either to show the user a regular exception or a subdomain not available exception, where would this code be? For example in the flexshop example in the cairgorm example you have some methods on the viewhelper that notify the user of the error. In my case I need to do some logic to know what error to show the user. Omar Ramos System Developer Nobox Marketing Group, Inc. On 8/10/05, Steven Webster <[EMAIL PROTECTED]> wrote: > Omar, > > ViewHelper should have *nothing* to do with handling faults. You will > have to decide how you choose to pass exceptions back from J2EE to > Flex; you can catch those either in the onResult() or onFault() > methods of your command classes, and handle accordingly. > > Note that you will not (typically) be throwing exceptions on the Java > side and catching them on the client side. Rather, if something > happens in your server-side POJO/delegate/whatever that you can't > handle, and need to defer to the client to handle, you will need to > conceive a mechanism for passing status between the server and client. > > I'd anticipate you doing this in the onResult() of a command, rather > than onFault(). > > But remember - ViewHelpers should only be used to prepare and massage > the model for rendering to the view. ViewHelpers are *not* catch all > places for any business logic that doesn't obviously fit in > controller/command/delegate or service locator !!! > > Best, > > Steven > > > -- > Steven Webster > Technical Director > iteration::two > [EMAIL PROTECTED] > > Office: +44 (0)131 338 6108 > Mobile: +44 (0)7977 216 223 > > This e-mail and any associated attachments transmitted with it may > contain confidential information and must not be copied, or disclosed, > or used by anyone other than the intended recipient(s). If you are not > the intended > recipient(s) please destroy this e-mail, and any copies of it, immediately. > > Please also note that while software systems have been used to try to > ensure that this e-mail has been swept for viruses, iteration::two do > not accept responsibility for any damage or loss caused in respect of > any viruses transmitted by the e-mail. Please ensure your own checks > are carried out before any attachments are opened. > > -----Original Message----- > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] > On Behalf Of Omar Ramos > Sent: 10 August 2005 18:49 > To: flexcoders@yahoogroups.com > Subject: Re: [flexcoders] Cairgorm command question. > > Yeah thats what I tought. Command would send the error code or message > to the view helper and the helper applies the logic and takes action > on the view. > > On 8/10/05, Omar Ramos <[EMAIL PROTECTED]> wrote: > > Yeah I mean from the server I mite send difrent types of errors for > > the same invocation. The logic for handeling the type of error and > > taking action on the view corresponds on the command or the > > viewhelper? > > > > On 8/10/05, Allen Manning <[EMAIL PROTECTED]> wrote: > > > Omar, > > > > > > I think 'onFault' or 'onStatus' is a method of the Responder. > > > > > > Allen > > > www.prismix.com/ > > > > > > > > > > > > -----Original Message----- > > > From: flexcoders@yahoogroups.com > > > [mailto:[EMAIL PROTECTED] > > > On Behalf Of Omar Ramos > > > Sent: 10 August 2005 18:10 > > > To: flexcoders@yahoogroups.com > > > Subject: [flexcoders] Cairgorm command question. > > > > > > Hi guys I have a simple question. Does my command need to have the > > > logic to manage the exceptiosn I recive from remoting and decide > > > what to do depending on the exception? or does that belong on the > > > view helper? Thanks for any feedback you can give with this. > > > > > > > > > Omar Ramos > > > > > > > > > > > > -- > > > Flexcoders Mailing List > > > FAQ: > > > > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > > > Search Archives: > > > > http://www.mail-archive.com/flexcoders%40yahoogroups.com > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Flexcoders Mailing List > > > FAQ: > > > > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > > > Search Archives: > > > > http://www.mail-archive.com/flexcoders%40yahoogroups.com > > > > > > > > > > > > SPONSORED LINKS > > > Computer software testing Macromedia flex Development Software > > > developer ________________________________ YAHOO! > GROUPS LINKS > > > > > > Visit your group "flexcoders" on the web. > > > > > > To unsubscribe from this group, send an email to: > > > [EMAIL PROTECTED] > > > > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > > > To unsubscribe from this group, send an email to: > > > [EMAIL PROTECTED] > > > > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > > > ________________________________ > > > > > > > > > -- > Flexcoders Mailing List > FAQ: > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.com > Yahoo! Groups Links > > > > > > > > > -- > Flexcoders Mailing List > FAQ: > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.com > > > ________________________________ > YAHOO! GROUPS LINKS > > Visit your group "flexcoders" on the web. > > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > ________________________________ > ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hske10i/M=362131.6882499.7825260.1510227 /D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123710185/A=2889191/R=0/SIG=10r90krvo /*http://www.thebeehive.org ">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy</a>.</font> --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h37kvml/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123713993/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992 ">Fair play? Video games influencing politics. Click and talk back!</a>.</font> --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/