The OO training in me says that these are 2 different methods, as they do 2
different things.
If you had a "get by name" or "get by number" I might try overloading, but
not here.
-- Ben Doom
Programmer & General Lackey
Moonbow Software, Inc
: -----Original Message-----
: From: jon hall [mailto:[EMAIL PROTECTED]
: Sent: Wednesday, May 28, 2003 7:43 PM
: To: CF-Talk
: Subject: two functions or one?
:
:
: I've run into this issue more than once, and am always not sure
: about the best way to go about this...
:
: I have an app that will require a way to get a list of, for example
: all products, and the same app needs to be able to get just one of
: the products using the product id.
:
: The query to the database is very similar in both cases, the only
: difference being the Where clause in the latter query. The two
: options I see are to build two methods, one called getProducts() and
: another called getProduct(), or build one method called getProduct()
: and give it an optional argument for the product id.
:
: Building one method is quicker, and makes for a less complicated
: object model, but for some reason I feel like it starts a slippery
: slope to mixing the data layer and the logic layer. Maybe the
: feeling is unfounded though, but maybe not. I'm not sure...
:
: I'd be really interested in hearing opinions on which method you guys
: prefer.
:
: --
: jon
: mailto:[EMAIL PROTECTED]
:
:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4