> Ok then - so that brings up -another- question. getAll by itself, IS rare. > Most of the time I'm doing getAll where Active=1, or getAll where Owner=Me, > or some such. So if we have a Gateway CFC to handle getting a bunch of crap, > where do we put filters? That's business logic - and it seems like it would > make sense in the core CFC for the datatype.
Often, in that situation, I'll actually create different methods for different filtering options. For example, I may have a CFC with these *public* methods: getAll() getAllActive() getByOwner( ownerID ) getAllPrecedingDate( date ) Those public methods would then simply relay the call to a *private* method that contains the SQL and could have an interface like Tim describes: getAll( condition, order ) That way, you get the best of both worlds... the caller doesn't know about the table structure, but your SQL code is isolated in a single private method. The public methods simply relay the appropriate information into the private method and return the results. ---------------------------------------------------------- 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 [EMAIL PROTECTED]
