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

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to