Hi everyone,

I am using the Fusebox 4 framework with CFCs (my company doesn't want to use
mach-ii by now) and still quite new to the OOP approach.

My Validation process initiates each time I call my setter-methods in the
CFC. Usually the validation processes when I call the method
setObjectByStruct(struct). 

The argument struct can then be a query or attributes from a form. Data
coming from the query doesn't need to be validated so the
setObjectByStruct(struct,structtype) is given the optional argument
structtype. This argument initiates the validation before setting the data
to the CFC's property (<cfif structtype neq "query">...do
validation...</cfif>). 

If an error occurred during the validation process the CFC's method
setError(datafield, message) is called. Through the getError() method I can
then check for errors and output some kind of message to the user.

What are your opinions about this validation process?

Greetings

Magnus


-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag
von Roland Collins
Gesendet: Freitag, 19. November 2004 21:23
An: [EMAIL PROTECTED]
Betreff: RE: [CFCDev] Validation

I use both methods where they make sense.  For instance, we have objects
which store configuration information - these are stateful (in fact, they're
singletons).  We have other objects which are used to connect to stock
pricing services - these all conform to the same interface (or same base
class in CF) and they are stateful as well.

The main API into our system, however, is not stateful - you do indeed pass
the key arguments into each method on every call.  This is done for several
reasons, among them being flexibility.  The nice part is that we can use the
API both for our own ends _and_ expose the entire as an API as a WebService
for our clients without having to rewrite anything.  Since WebServices, by
definition, are not stateful, our API cannot be either.

Hope that helps!
Roland

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Dawson, Michael
Sent: Friday, November 19, 2004 11:28 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Validation

Roland, I have another related question.

When you created CFCs, are they stateful in that they store data for the
duration of the request or do you use them as mere function libraries?
In other words, do you pass arguments to each and every method that is
declared in the CFC?

Thanks
M!ke 



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at 
[EMAIL PROTECTED]

Reply via email to