Re: [CFCDev] CFC base class with arbitray arguments calling a virtual function

2003-10-07 Thread Nathan Dintenfass
Oh yeah, damn -- can't believe I forgot that. Guess you'll have to pass it in as a struct (or define your arguments in advance) and do some work to build your abstraction. > From: Sean A Corfield <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > Date: Tue, 7 Oct 2003 23:00:54 -0700 > To: [EMAI

Re: [CFCDev] CFC base class with arbitray arguments calling a virtual function

2003-10-07 Thread Sean A Corfield
On Monday, Oct 6, 2003, at 11:13 US/Pacific, Nathan Dintenfass wrote: But, that said, if you want to do what you are doing, one option would be to actually have a getRecordSet method in your extending component that calls super.getRecordSet() ... Unfortunately, you cannot do that :( When yo

Re: [CFCDev] Extending Multiple Components

2003-10-07 Thread Sean A Corfield
On Monday, Oct 6, 2003, at 07:51 US/Pacific, Dave Carabetta wrote: Is it possible to extend multiple components with one component? Is so, how? No it is not possible. In CF (and JAVA), there is only single inheritance. However, with CF, you can add methods to the /WEB-INF/cftags/component.cfc an

Re: [CFCDev] Variable referencing in CFCs

2003-10-07 Thread Sean A Corfield
On Monday, Oct 6, 2003, at 08:02 US/Pacific, Bryan F. Hogan wrote: I've heard that in order for a variable only to exist within a specific function that you var scope it. Correct. However, they also say that you don't reference the var scoped variable with the Variables scope prefix. Correct. 'va

Re: [CFCDev] Variable referencing in CFCs

2003-10-07 Thread Sean A Corfield
On Monday, Oct 6, 2003, at 08:27 US/Pacific, Bryan F. Hogan wrote: #Variables.thisTest# works in regular CFML pages. But in regular CFML pages, "thisTest=1" is shorthand for "variables.thisTest=1" whereas if you say (inside a UDF / CFC method): then you are creating thisTest in 'var' scope whic

[CFCDev] Performance advantage of stateful CFCs?

2003-10-07 Thread Cohen, Michael
How much of a performance advantage is storing your model (and controller) CFCs in application or session scope? And if it's that much, why wouldn't you want to store everything in the application scope (or session where appropriate)? I mean, why wouldn't you want to put all of your view pages into

Re: [CFCDev] Code Reuse

2003-10-07 Thread Marcantonio Silva
Well,   If if you do customer = from, I´m sure your code will work fine.   But as CF works, when you do this, you´re simply sayng that the variable name "customer" is a pointer to the structure "form". Any change made in the customer struct will change the value of the form, because they´re

Re: [CFCDev] Variable referencing in CFCs

2003-10-07 Thread Joe Eugene
> exactly what you shouldn't do -- keep your instance data inside your CFC and > build the appropriate API using methods to get the data out in a way that > makes sense for your component. Exactly.. use accessor methods to access the Class Instance Variables... I see what you are getting to now..

RE: [CFCDev] Data validation

2003-10-07 Thread Barney Boisvert
PREFACE: This isn't a personal attack on you, Andy. If it sounds that way, it's because of the impersonal communication mechanism, not my intentions. To paraphrase, "fu**in' email". Using objects doesn't mean you're doing OO programming. I can take a vanilla FB application, convert each circuit

RE: [CFCDev] Variable referencing in CFCs

2003-10-07 Thread Nathan Dintenfass
I'm not sure I understand what you are asking. If you return "THIS" you can simply string the init() method on your createObject call. So, something like: user = createObject("...").init("Nathan","Dintenfass"); userName = user.getName(); I don't understand what you mean by "variables.user.firs

Re: [CFCDev] Variable referencing in CFCs

2003-10-07 Thread Joe Eugene
> I also always return THIS from the init() method to allow me to do: > foo = createobject("component","foo").init(); If you return THIS from the init() method, you only get reference to Instance methods. No Instance variables are returned. >From the below example.. user = createObject("Component

RE: [CFCDev] Code Reuse

2003-10-07 Thread Dawson, Michael
Title: Message Global Search and Replace   :) -Original Message-From: Paul Giesenhagen [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 07, 2003 4:02 PMTo: [EMAIL PROTECTED]Subject: Re: [CFCDev] Code Reuse Yes, I see your point, but it seems that you have a chunk of

Re: [CFCDev] Code Reuse

2003-10-07 Thread Paul Giesenhagen
So if you have form.firstName and form.lastName   Doing this isn't good enough:     You must // once you do the above // customer will now hold the form values in the customer struct?     #customer.firstName#     Paul Giesenhagen QuillDesign   - Original Message - From:

Re: [CFCDev] Code Reuse

2003-10-07 Thread Paul Giesenhagen
Title: Message Yes, I see your point, but it seems that you have a chunk of code (the cfc) that is re-usable (which is good), but everwhere you call the cfc you have to update if you change firstName to first_name thus it leaves you in the same situation before you did code reuse.   This is

Re: [CFCDev] Code Reuse

2003-10-07 Thread Marcantonio Silva
Hi Paul,   It is possible and recommended. In fact, you shoudn´t have FORM or any other scope favriables inside your cfc, only arguments, thats the best practice.   Althou you may want to pass and get every argument independenttly, which seems more flexible and more OO.   As you mnay know, fo

RE: [CFCDev] Code Reuse

2003-10-07 Thread Dawson, Michael
Title: Message Rather than let the cfc know about the two different ways it can get data, just let it concentrate only on one.  The cfc should only accept firstName and lastName.  In your code that calls the cfc, use a cfif to determine which set of variables will populate the cfc.   One mi

RE: [CFCDev] Code Reuse

2003-10-07 Thread Jeff Britts
A form is a structso it should work fine either way -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Paul GiesenhagenSent: Tuesday, October 07, 2003 4:43 PMTo: [EMAIL PROTECTED]Subject: [CFCDev] Code Reuse Ok, I am really trying to utiliz

[CFCDev] Code Reuse

2003-10-07 Thread Paul Giesenhagen
Ok, I am really trying to utilize CFC's and utilize their pronounced ability to handle alot of good code reuse.   I have a CFC that handles customer information.  And I have two ways that customer information can be populated and manipulated:   1) Through a form (form.firstName, form.lastNam

RE: [CFCDev] Dynamic SQL, Stored Procs, and Reports? [self respon se]

2003-10-07 Thread Justin Balog
Sorry about the OT, but both replies have me thinking. Thanks much as always. Take care, Justin -Original Message- From: Nathan Dintenfass [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 07, 2003 1:06 PM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] Dynamic SQL, Stored Procs, and Reports

RE: [CFCDev] Dynamic SQL, Stored Procs, and Reports? [self respon se]

2003-10-07 Thread Barney Boisvert
No way around writting it to a file first. CF is a file driven language, so if you want to execute code, it has to be contained within a file. It's certainly not an ideal solution, but one that makes sense for certain situations. If you're not needing tremendous scalability and you're on CFMX 6.

RE: [CFCDev] Dynamic SQL, Stored Procs, and Reports? [self respon se]

2003-10-07 Thread Nathan Dintenfass
[insert obligatory urging to keep posts on topic -- about CFCs] You can do that, but generally speaking it's a bad idea. Performance will be considerably less than optimal using that method, which likely defeats much of the benefit of using a stored proc in the first place. Why not just dynamic

RE: [CFCDev] Dynamic SQL, Stored Procs, and Reports? [self respon se]

2003-10-07 Thread Justin Balog
I have found you can write the code to a file then include it, and that seems to be a horribly bad idea. Is there any other way to execute dynamically built cf code? I want to build this string and execute it? Sorry for the OT. Justin -Original Message- From: Justin Balog [

[CFCDev] Dynamic SQL, Stored Procs, and Reports?

2003-10-07 Thread Justin Balog
Howdy, Kind of on the topic or reports, I was looking to build by storedproc call dynamically, then execute it in my report cfc. Has anyone ever done this, if so, do you evaluate the built string? Thanks, Justin -- You are subscribed to

Re: [CFCDev] Data validation

2003-10-07 Thread cf_nut
We're using an adapted version of FuseBuilder to generate our data components. Fusebuilder (as downloaded) generates useful qry_ fusefiles from a SQL Server DB. We adapted it to generate data components based on a PostgreSQL DB. I think Barry (who did all the work on this) plans to put somethin

RE: [CFCDev] Using Structs

2003-10-07 Thread Ung, Seng
Adam and Jeff Excellent! I learned something today Thanks -Original Message- From: Adam Wayne Lehman [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 07, 2003 10:08 AM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] Using Structs I might be missing your question but simple loop should

RE: [CFCDev] Using Structs

2003-10-07 Thread Adam Wayne Lehman
I might be missing your question but simple loop should do the trick for accessing the data and populating your select box. If you are talking about dynamically creating the array from a query you can just use arrayAppend() like so: state = arrayNew(1); for(i = 1; i LTE stateQuery

RE: [CFCDev] Using Structs

2003-10-07 Thread jeff tapper
how about state[2]= structNew(); state[2].name = "New York"; state[2].addb = "NY"; just adding each state into a new index of the first dimension. Actually, theres no real need to use an array at all, it could all be a struct: state = structNew(); state["AL"] = "Alabama"; state["NY"] = "New York

RE: [CFCDev] Data validation

2003-10-07 Thread Barney Boisvert
How do you go about generating your data layer objects from your database? Some sort of automated process? I'd be very interested to see how that works. The lack of a good IDE for CFCs makes for a lot of legwork that I'd love to avoid. I assume that your data layer is doing type checking and suc

RE: [CFCDev] Variable referencing in CFCs

2003-10-07 Thread Nathan Dintenfass
Yes, though I set up the variables in the init() method instead of the pseudo-constructor area. I also usually don't put variables. in front of instance once I've created it. I also always return THIS from the init() method to allow me to do: foo = createobject("component","foo").init(); But, y

Re: [CFCDev] Variable referencing in CFCs

2003-10-07 Thread Joe Eugene
> instance.userID = userIDValue; > instance.familyName = getUser.familyName; Ok. this sounds good usage... but still it looks kinda messy compared to Java OOP. > As for returning "VARIABLES" -- this is something that should be done very > rarely and only when you need to abstractly do things like

RE: [CFCDev] Variable referencing in CFCs

2003-10-07 Thread Nathan Dintenfass
I am indeed saying that you should not use "this" to hold your instance data. There was some justification for in 6.0 because the VARIABLES scope was broken, but in 6.1 that justification is gone. Your second alternative would be more aptly: variables.userID = userIDValue; variables.familyName =

Re: [CFCDev] Data validation

2003-10-07 Thread cf_nut
I'm having trouble seeing what 'legitimate' reason there might be for storing an instance of 900-year old person in your database. 900 years looks suspiciously like a 'flag' value to me, and if that's the case, I think I'd prefer to address it by modifying the database table (or object definiti

Re: [CFCDev] Data validation

2003-10-07 Thread cf_nut
Hi Barney, I think I'm starting to see where our differences arise :-) CFTRY vs CFIF: -- I hadn't thought of the differences in approaches being procedural vs event-driven, but that ties in well with the fact that the caller of the objects, in our case, is a presentation layer writ