My 2 cents - if these are persisted in a database, I use the Transfer ORM
framework, which handles composition with very little fuss.
If not persisted, I would have the User class/manager/service object
construct the User object:
in UserClass.new():
aUser = CreateObject( "component", "User").init(
name = "Fred Bloggs",
workAddress = variables.AddressClass.new(
<initial address params>
),
homeAddress = variables.AddressClass.new(
<initial address params>
)
);
AddressClass is the Address class/manager/service object, which has been
injected into the UserClass object when it was created.
Jaime Metcher
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of J MacKay
Sent: Thursday, 5 April 2007 7:19 AM
To: [email protected]
Subject: [CFCDEV] newbie - where to handle component composition
Let's say you have a component composed of other components: like a
User.cfc that contains one or more instances of Address.cfc (work address,
etc)
Where do you pull the two pieces of information together (user and address
info) to construct a complete User object? Within a manager or service
component?
I know every situation is different. I'm just trying to get a better
understanding of this.
--
----------------------------------------------------------------------------
--
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.
You are subscribed to cfcdev. To unsubscribe, please follow the
instructions at http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]