If you want this to be completely reusable, why not create the
messageService component that all other components can use?

Basically, it would contain an array or struct of messages and related
lookup codes.

You could have a function "getMessageForCode()" that accepts a numeric
value for the lookup code such as "getMessageForCode(319)" which may
return the string "The primary key value already exists..."

I'm curious how you intend on using something like this.  Would you
return the error string in the function or would you throw an error with
the error string as part of the CFTHROW attributes?

Once we have finished discussing this, it would be nice to see a short,
complete example.

M!ke

-----Original Message-----
From: Phillip Cave [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 24, 2004 3:48 PM
To: [EMAIL PROTECTED]
Subject: [CFCDev] Messages


Does anyone have any recommendations as to where to store message
strings for a particular component. Essentially what I want to do is not
to have to define the same set of error messages more then once. An
example would be error messages that get displayed to a user. I would
like to use the same messages for both client and server side validation
without hard coding it into source files. 

I thought about having one big messageService component that contained
(or read from a file) all the messages for a system. Then I thought that
having some sort of message component for each business object.

Does anyone have any ideas?

Thanks,
Phillip

----------------------------------------------------------
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
www.mail-archive.com/[EMAIL PROTECTED]
----------------------------------------------------------
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 www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to