It's quite simple. Validation is half of what business rules are. Validating 
that information is of a necessary format. The data
format (and thus, it's validation rules) are technology and presentation 
agnostic. The model should have the final say on whether
it's contents are currently valid or not.

Ruby on Rails has validation in the model, and the view has helper 
functionality which makes presenting validation errors easily...
But the actual validation itself happens on the model.

In Flex, the reason validators are in the views is because that's where we can 
-do- something about invalid data easily, ie
highlight a field, point a help bubble at it, stop the form from submitting etc.

I guess because Flex is a presentation framework, the emphasis is on the 
display of/interaction with data. The V is the primary
aspect. With Rails, since it's a full web stack, the validation sits where it 
logically should; in the model.

As to what to actually do with this information; go with the convention: stick 
it in the view. That's the way the framework has been
designed, and everything should fall into place with it.

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
lostinrecursion
Sent: 07 September 2006 10:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Cairngorm... Where should this go?

Sorry but I have to interject on this. Intsrestingly enough I asked a similar 
question some days ago and did not receive a response
from a design pettern perspective, but from a "what works" perspective. I am 
actually 85% of the tim all about what works, so not
there is anything wrong with it. But, I would like to hear some other rhoughts 
on it since Validation is integral to just about
every RIA that accepts data on the planet.

In MVC, the Validators seem to be more of a middle ground issue. Since the 
Model contains the business logic and is fed data to
process and the controller merely acts as waystation back and forth from view 
to model, it would seem to me that there should almost
be another letter in MVC since validation doesn't really fit anywhere.

However, it would seem to me that a Validation function would be placed in the 
model itself. Since the view should only query the
model to get its current state and accept the user input, it seems it should 
not be in the View to promote modularity.
{myModel.dataIsValid == true}

Because what if you wanted to add another View to the application??
(As the OP mentioned) Seems to me like it would be malformed in the View.

Hmmmm... Perhaps MVCV - ;)






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






 



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.1/440 - Release Date: 2006/09/06
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.1/440 - Release Date: 2006/09/06
 



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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> 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/
 



Reply via email to