On Tue, 25 Jan 2005 18:10:22 -0200, Marcantonio Silva <[EMAIL PROTECTED]> wrote: > > Inside the bean I init the DAO from the factory: > > [article.cfc init()]: > cfset variables.articleDAO = > createObject("component","model.factory.DAOFactory").init(arguments.stConfig).getDAOFactory(factoryType:arguments.stConfig.dbtype).getArticleDAO(arguments.stConfig)
It would probably be better if your Article CFC only knew about the state of an article and what an article can do. It shouldn't have to worry about how articles are stored. That's the DAO's job. The DAO should know how to get the data from the database (or an XML file, or a data gateway, or something) and create an article object (perhaps with the help of an ArticleFactory). You only need one DAO. Maybe it comes from a factory that instantiates the right DAO given a text string ("MSSQL", "ORA", etc). And maybe, if necessary, you can make sure the factory returns a reference to an existing DAO if it has already created a suitable one. HTH, Patrick -- Patrick McElhaney 704.560.9117 http://pmcelhaney.blogspot.com ---------------------------------------------------------- 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 www.mail-archive.com/cfcdev@cfczone.org