My gut feeling is that I'm going to go this route. I still need time to get to it, but it *feels* the best out of all the options. It's widely applicable, completely ignorable, and very flexible.
To me it certainly feels less hackish than the configuration option. Doug -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sean Corfield Sent: Friday, March 24, 2006 1:23 PM To: [email protected] Subject: [Reactor For CF] getXyzRecord() - alternative proposal This occurred to me halfway down I-680 on the way to work this morning: First off, a little context. Reactor goes out of its way to provide you with *three* versions of each generated file: - project/foo/Record/xyzRecord.cfc - mapping/Record/xyzRecord.cfc - mapping/Record/xyzRecorddbtype.cfc (one for each DB) The former is inviolate Reactor-generated code and gets recreated whenever things change or you tell Reactor to do so. The latter two are created once and are where Reactor expects you to make customizations. So Reactor already caters for any customization you might want to do: it generates shell CFCs for you that it never overwrites. What Kurt and Shannon want is a customization of Reactor's default behavior. Reactor "expects" this to happen in the mapping/Record/xyzRecord.cfc (or the DB-specific ones). So the Reactor-idiomatic way to address their issue would be to add a custom method (probably to mapping/Record/xyzRecord.cfc) called getFoo() which simply contains: <cfreturn getFooRecord() /> Let's take a quick look at Transfer. It allows you to specify methods in the XML file (in <![CDATA[ ... ]]> sections) that are automatically pushed into the generated CFC code. Hmm, what if Reactor provided a way to do something similar in a more generic way? Well, it *almost* does. It has record.base.xsl and record.custom.xsl where such methods could live. Except that right now, Reactor always uses the built-in versions from the install. Proposal: Provide a way to tell Reactor to use a different XSL file for base/custom versions (Doug actually mentioned something along these lines). I don't know whether it should be per-object or per-project (probably per-project - then it could just be a directory path to search for the customized XSL files and, if not found, default to the built-in ones). This would allow Shannon / Kurt to create a modified record.base.xsl file that could override the default behavior in a way that I think is much more idiomatic for the framework. I also think this would be a much more powerful solution for advanced users of Reactor. Thoughts? -- Sean A Corfield -- http://corfield.org/ Got frameworks? "If you're not annoying somebody, you're not really alive." -- Margaret Atwood -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/ -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

