I think that realistically, there's always a time to break the
rules... even if you follow them to the letter 99% of the time.
Granted, saying "I will ALWAYS pass a query into this CFC" is just
begging for someone to change the rules. Unless you're writing a query
parser for some specfic purpose. Or you're writing your own app for
something specific. Or it's not going to matter what language or
framework you're working with, you're always going to pass a resultset
into a particular instance.

It's the flexibility that one gains from OO that makes it valuable.
When creating a new class for something that could be passed around as
a parameter becomes more work than it's actually worth, I would think
then is a good time to play Pass the Query. Whether you pass a query
or not isn't really even the issue, as log as there's a
well-documented model and/or API for what you've created, and it's
flexible enough to do what you need it to.

Then again, when I worked in corporate live I was constantly called a
"cowboy," and man they take that label way too seriously.

Laterz,
J




On Mon, 17 Jan 2005 14:51:56 -0800, Adam Haskell <[EMAIL PROTECTED]> wrote:
> > into the DB. I'm sure that a CFC depending on environmental data (CGI, Form,
> > etc.) rather than explicitly passing that data in is a violation of some
> > rules somewhere.
>  yeah it is...i think even Forta's intro to CFCs calls this a no no.
> But thats more from the standpoint that it hampers reusability. In our
> enviroment (as whacky as it is) this would be a BIG no no since Form
> data is replicated to URL data and passed to the same page on
> subsequent calls.
> 
> Adam H
> 
> On Mon, 17 Jan 2005 17:41:21 -0500, Michael Dinowitz
> <[EMAIL PROTECTED]> wrote:
> > When I do a query it's super tight. It only has the important data that I
> > want to deal with. That being said, when I pass that query it's because I
> > want to work with all the data. As I make more changes to the HoF site and
> > optimize it more under Blackstone, I'll probably change how I do things.
> >
> > But then again, I do some strange things with CFCs.
> > Take a form that posts it's data to a database. The CFC that does the work
> > for that form will not have any arguments. It's assumed that the form scope
> > exists and I test the variables I want inside the CFC before I enter then
> > into the DB. I'm sure that a CFC depending on environmental data (CGI, Form,
> > etc.) rather than explicitly passing that data in is a violation of some
> > rules somewhere.
> >
> > Actually, the same goes for my logging CFC which assumes that there will be
> > a CGI scope with data for it to use.
> >
> > > When do you passa query to a CFC? I would think you would pass an
> > > object the has a query set in it maybe but a complete Query? I mean I
> > > am sure there are valid reason but none are coming to mind :)
> > >
> > > Adam H
> > >
> > >
> > > On Mon, 17 Jan 2005 16:22:30 -0500, Michael Dinowitz
> > > <[EMAIL PROTECTED]> wrote:
> > > > I pass queries to CFCs all the time when there's a need. I don't see it
> > > as
> > > > making a mockery of CFCs.
> > > > As for debugging, it's my own state of mind. This site has over 40
> > > includes
> > > > per page and that number makes me crazy. I like my code tight and clean
> > > and
> > > > this site is no where near that. :(
> > > >
> > > > > Yes but you will be able to sleep better at night knowing you have not
> > > > > made a complete mokary of CFCs by passing a whole query into it ;)
> > > > > Besides debugging can be turn off ;)
> > > > >
> > > > > Just feel lucky you can use CFCs the company I moved to is still on
> > > > > CF5...*sigh*
> > > >
> > > >
> > >
> > >
> >
> >
> 


-- 
Continuum Media Group LLC
Burnsville, MN 55337
http://www.web-relevant.com
http://cfobjective.blogspot.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190864
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to