Jim,

as long as the methods are related to each other, there's no reason to split them up. However, there is an issue where the size of the file can be too large. IIRC, java has a limit on compiled class files (64k?). Therefore, if you just have too much code in a single CFC, you'll get an error when you try to run it.

IMO, what that design principle is getting at is don't shove too many unrelated methods into an object. i.e. If an object is a Bean, it shouldn't have methods that interact with the database. That's the job of a DAO or a Gateway.

If you're calling multiple methods from the same CFC using cfinvoke, don't forget to call cfobject first ( the tag version of createObject() ) so that you can create the CFC object _once_, then use cfinvoke to call methods from that object. IIRC, if you don't use cfobject and only use multiple cfinvokes, you're recreating that same cfc object for each method you invoke.

-- Adrian

Jim Cassata wrote:
ok, but is the one thing the cffunction or the cfcomponent? Should each cfinvoke mean each own cfc? only one method per cfc? If so I will have over 100 cfcs, and that doesnt seem to me to make things more manageable.

Thanks.

----- Original Message ----
From: Nando <[EMAIL PROTECTED]>
To: [email protected]
Sent: Sunday, March 4, 2007 3:58:59 PM
Subject: Re: [CFCDEV] how much is too much?

There's an object-oriented design principle that says an object should do one thing and do it well.



You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]

Reply via email to