Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: mx.controls.Alert usage, PureMVC Best Practice Suggestion?  (Read 7002 times)
maddec
Courseware Beta
Newbie
***
Posts: 7



View Profile WWW Email
« on: January 18, 2008, 02:32:08 »

Hi there,

I wonder if they are best practice suggestion regarding how to organize the use of mx.controls.Alert.

I wonder if gathering alert logic inside a Mediator is a good approach.

I mean having an AlertMediator which may be interested in every notifications related to alerts. Then modifing the Alert type depending to the context.
The question which remains open is how callbacks are used ( for example for confirmation Alerts (YES|NO) ).
Thank you for your interest.

Best regards.


Cedric M. (aka maddec)

----------------------------------------------------
http://analogdesign.ch
http://analogdesign.ch/blog
visual & interactive communication
----------------------------------------------------
Logged
nilsm
Jr. Member
**
Posts: 19


View Profile Email
« Reply #1 on: January 25, 2008, 05:37:41 »

Hi Cedric,

I just started writing a reply but it got more and more complex, so I guess the answer is "It depends on the requirements" :)

I think for the usage you are describing, you could use a value object as the Notification body, that includes an error code, the error description and the notifications to send on 'ok' and 'cancel'. You have to be careful though because you don't want to include any view information in there - so the type of alert to show should be determined in the Mediator (and the error descriptions should probably come from another Proxy).

In a simpler case, where no command/proxy interaction is required, you could just handle the entire process inside a single Mediator - after a particular user gesture, the Mediator pops up the Alert and only sends a Notification if 'ok' was clicked for example.

Getting long again - I'd better stop here :)

- Nils.



Logged
Pages: [1]
Print