I think it depends on the cfc and it's purpose.

You could write one generic class, lets say called

Database.cfc

Which could have methods such as select, update, insert etc. Then they could
take paramaters such as you described in 2. This class is then generic and
can be smart enough to update any table.

If however you have a class called say

Product.cfc

And it deals only with products and it has an update method, then I would
suggest option 1, as then the method constrains the required fields and can
have intelligence.

If you are really keen you could have Product.cfc extend Database.cfc

Regards
Dale Fraser

http://dalefraser.blogspot.com


-----Original Message-----
From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Adam Chapman
Sent: Tuesday, 29 May 2007 10:54 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] cfc - cfargument best practice


Hi All,

I have the need to create a cfc method which will update a large number
of db fields.. (50+). Here are 2 options I'm considering:

1. Accept an argument for each field
2. Accept a single argument containing a structure with all the data
required for each field

Thoughts?

Cheers,
Adam






--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to