[Arp] Dispatch event or internal ?

Nils Millahn nils.millahn at deltabravo.com
Fri May 27 02:06:51 PDT 2005


I would agree with this. The only thing I wonder is whether the 
password/username requirements (number of characters, etc) are actually 
part of the business logic, rather than the display logic. If you look 
at it that way, it would be a good idea (but more long-winded :)) to 
send a system event.

Only thing is, you would need to do it after every single character that 
gets entered and it does seem like quite a complex way of going about 
it. So how about sending a system event to fetch username/password 
requirements when the form is first displayed? I think I would prefer 
that option - at least it decouples some of the business logic from the 
view, rather than hard-coding that bit into the view itself.

[You could actually argue that disabling the submit button until the 
correct length is obtained is reducing the security because you are 
revealing information about your password/username requirements.]

- Nils.



Tim Beynart wrote:

>I asked a similar question on the FlashCoders list, and I think it boils
>down to personal preference. I know when I have events within a class
>that only affect constiuents of that class, I don't bother with
>dispatching events. 
>
>
>- - - - - - - - - - - - 
>Tim Beynart
>Athens, GA
>706.372.6994
>- - - - - - - - - - - -
>
>-----Original Message-----
>From: Arp-bounces at ariaware.com [mailto:Arp-bounces at ariaware.com] On
>Behalf Of Davies, Grant M.
>Sent: Thursday, May 26, 2005 11:51 AM
>To: 'General List for Ariaware RIA Platform users and developers'
>Subject: [Arp] Dispatch event or internal ?
>
>Hi guys, have a fairly simple design question but wanted to see the best
>way of implementing this using ARP.
>
>I have a loginForm that has a id, password and button, I catch the id -
>changed event and the password changed event so that the login button is
>grayed out when those fields are not valid, I have strict validation
>that the id must be 5 characters or more (RACF security) and the
>password must be exactly 8 characters.
>
>What I was wondering is should I keep to booleans in my LoginFrom class 
>
>var idValid:Boolean;
>var passwordValid:Boolean;
>
>and when catch the change event for id set the idValid property to true
>or false and then call another method called "updateLoginButton" that
>says something like 
>
>if (idValid == true && passwordValid == true) 
>	loginButton.enabeled = true;
>else 
>	loginButton.enabled = false;
>
>or....
>
>when the idValid or passwordValid fields are changed I fire a new event
>like
>
>dispatchEvent( {type:"idStateChanged"});
>
>and have my LoginForm register as a listener to its own "system" event
>and then have it update the login button after receiving a
>"idStateChanged"
>event ?
>
>It seems to me that this should all be handled inside the LoginForm and
>not be published as a system event but I wanted to confirm this before
>moving forward as I'm new to the ARP framework.
>
>Grant
>
>_______________________________________________
>Arp mailing list
>Arp at ariaware.com
>http://ariaware.com/mailman/listinfo/arp_ariaware.com
>
>_______________________________________________
>Arp mailing list
>Arp at ariaware.com
>http://ariaware.com/mailman/listinfo/arp_ariaware.com
>
>
>  
>




More information about the Arp mailing list