firstly let me preface this post with two cavats:
1) I'm just looking for opinions, thoughts, etc to sway the decision one way or another. "Should we or shouldn't we" stuff
2) IMHO, the power (ands flexability) of CFC's comes from not just calling methods but in it's ability to store context data/values as well - "objects"
I would agree with point 2. The benefit over a CFC compared to a UDF is that you can encapsulate data in addition to just functionality.
For our enterprise app at the moment (a web version of a 15 yo legacy app), all data is returned based on what company_id a user has logged in at. this means that every db table, every method call - everything - needs this company_id to work (ie: each db table stores multiple company data where the companies are subsets of a particular organisation).
(pls note: this is a legacy app - while I would not do things this way if I had a clean slate, it *does work*...)
this means that for app-wide values (not specific entity data) either:
- it may be pointless to store db data as object properties (depends on the user's context - session.company_id - from the login process) so the server-stored CFC's turn into no more than collections of UDF OR...
- store cfc properties as arrays, based on company_id. sure this is more work, but at least we can persist "objects" in server scope and cut down on the db hits
Unfortunately, I don't think I understand enough at this point to make recommendations. Other posts in this thread offered some insight, but I'll attempt to throw in my .02.
At a high level, it sounds as if you are filtering queries based on the CompanyID. If that is true, why not build your CFCs with the CompanyID as a parameter (which you can set from the session variable when initing the CFC). It was stated that you wanted to build some form of caching mechanism. I see nothing wrong w/ that.
Using an array may be troublesome (how do you know which item in the array refers to which companyID). However, a structure of queries based on the companyID may make the most sense.
--
Jeffry Houser, Web Developer, Writer, Songwriter, Recording Engineer
AIM: Reboog711 | Phone: 1-203-379-0773
--
My Books: <http://www.instantcoldfusion.com>
My Recording Studio: <http://www.fcfstudios.com>
My Energetic Acoustic Rock Band: <http://www.farcryfly.com>
--
When did Reality Become TV
----------------------------------------------------------
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]
