On 11/15/05, Sean Corfield <[EMAIL PROTECTED]> wrote:
> On 11/15/05, Nando <[EMAIL PROTECTED]> wrote:
> > Would you call it a Factory if it *contains* stateless instantiated objects
> > (in application scope) and makes them available to the rest of the
> > application, but didn't actually instantiate them? Or a Service? I was
> > thinking that's a Service, hence i called it a DaoService, because it merely
> > contains the instantiated objects and exposes them to the rest of the app to
> > use.
>
> Well, you're talking about an implementation detail. The factory is
> still how the rest of the app gets the DAO objects.
You're talking about a design detail. ;-)
Creating objects and keeping track of instances are two different
responsibilities. If one CFC covers both responsibilities, I don't
have a problem with calling it a factory. But what do you call this?
<!--- First, create some DAO objects --->
<cfset userDAO = createObject("component", "userDAO")/>
<cfset groupDAO = createObject("component", "groupDAO")/>
<!---
Now, stuff them in my "how the rest of the app
gets the DAO objects" object.
--->
<cfset HtRotAGtDAOO= createObject("component", "????????")/>
<cfset HtRotAGtDAOO.setUserDAO(userDAO)/>
<cfset HtRotAGtDAOO.setGroupDAO(groupDAO)/>
<!--- later, I use my HTRotAGtDAOO object to get the userDAO --->
<cfset userDAO = HtRotAGtDAOO.getUserDAO()/>
Patrick
--
Patrick McElhaney
704.560.9117
http://pmcelhaney.weblogs.us
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]