Stacy I utilize a similar framework for my auction manager. However
where mine differs is that I have a function which determines the name
of the object to be called.
So for example
<cfset bid = createObject('Component', determineBidType(
arguments.bidType ) />
where determineBid is as follows:
function determineBid() {
arguments name="bidType"
var bidName = ""
<cfswitch expression="#arguments.bidType">
<cfcase value="1">cfset bidName =
"model.english_bid"></cfcase>
<cfcase value="2">cfset bidName =
"model.buyNow_bid"></cfcase>
</cfwitch>
return bidName
}
This way your CFCs can have more meaningful names than just something_1
BTW pardon my mix of Actionscript and CF in the above function but I
hope you get the general idea.
HTH
Kubeworks, LLC
We focus on technology so you can focus on your customers.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Stacy Young
Sent: Thursday, October 09, 2003 12:36 AM
To: [EMAIL PROTECTED]
Subject: [CFCDev] Modeling CFCs, basic example Part II
I've got a "Report" object which has properties & methods such as:
set/getHeader
set/getRecordset
set/getFooter
set/getTitle
set/getColumnOrder
etc
I've got a "ReportManager" which adds a persistence option when invoking
the Report. i.e. The report may be created for a CSV dump or rendered as
a pageable recordset for use in HTML display.
Where I'm stuck is how to properly model the database query. I was
planning on extending this generic Report object for each report type we
require. Each subclass would most likely contain a method or two that
deal strictly with excuting the SQL or proc and populating the
"recordset" property of the Report object in question. (this make
sense?)
If this is a sound approach...I'm wondering if I can have the
ReportManager accept a "reportType" as a parameter and have it
dynamically formulate the target subclass as follows:
CreateObject("component","com.terrapayments.reports.#arguments.ReportTyp
e#").init()
This way I can add a new report just by dropping in a new subclass of
Report and not have to touch any other components going forward.
Good or ugly? Appreciate ur insights as always. ;)
Stace
AVIS IMPORTANT:
-------------------------------
Les informations contenues dans le present document et ses pieces
jointes sont strictement confidentielles et reservees a l'usage de la
(des) personne(s) a qui il est adresse. Si vous n'etes pas le
destinataire, soyez avise que toute divulgation, distribution, copie, ou
autre utilisation de ces informations est strictement prohibee. Si vous
avez recu ce document par erreur, veuillez s'il vous plait communiquer
immediatement avec l'expediteur et detruire ce document sans en faire de
copie sous quelque forme.
WARNING:
-------------------------------
The information contained in this document and attachments is
confidential and intended only for the person(s) named above. If you are
not the intended recipient you are hereby notified that any disclosure,
copying, distribution, or any other use of the information is strictly
prohibited. If you have received this document by mistake, please notify
the sender immediately and destroy this document and attachments without
making any copy of any kind.
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word '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 word '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]