Matt,

I have been studying your code in great depth these last two weeks. I
have noted that you populate an array of addresses and pass it to the
person bean, all in the personAddressService.cfc.

I was about to implement your code when I found another example (from
an unknown source - no comments in the files). The files were from a
DCCFUG presentation. What they have done is pass the person service
the reference to the address gateway and then return a query of
addresses.

Either way, I think I've got I understand how to create the
one-to-many relationship and such. However, what I am wondering is if
it is just as well to simply call each object seperately. Call the
getPerson() method of the personService and pass in the person id and
return a person object. Then call the getAddresses() method of the
addressService and pass in the person id and return a query of
addresses with a matching personid. What is best OO practices?

-Aaron

On 12/7/06, Matt Williams <[EMAIL PROTECTED]> wrote:
> On 12/7/06, Aaron Roberson <[EMAIL PROTECTED]> wrote:
> > Is it better to create a "has-a" relationship between one-to-many
> > objects than to just invoke the objects separately?
> >
> > For instance, I have a product object (bean, DAO, gateway and service)
> > and a product items object (bean, DAO, gateway, service). Each product
> > has many product items. Is it better to map the product items to the
> > product object (array, struct or query) through the product's service
> > layer or to just invoke each object and pass them the product id?
> >
>
> Aaron,
>
> Here is one way I handled this type of issue using the Person with
> many Addresses idea.
> http://mattw.mxdj.com/sample_servicedaobean_files.htm
>
> --
> Matt Williams
> "It's the question that drives us."
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263228
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to