That'd be a registry, probably named DAORegistry in this case. But
assuming the registry is part of a single app, I'd definitely take the
time to wrap it up in a factory facade, because to the rest of the
app, that's what it is.
If the registry is floating outside the app (like a JNDI registry), or
if you know that will be the eventuality for your app, then leaving it
as a registry makes more sense. However, there's still an argument
for wrapping the registry up in a factory for the sake of your
application. So the 'factory' would actually be a facade/adapter in
implementation.
cheers,
barneyb
On 11/15/05, Patrick McElhaney <[EMAIL PROTECTED]> wrote:
> 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
>
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/
Got Gmail? I have 100 invites.
----------------------------------------------------------
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]