I'm not sure if I fully understand your question, but here are some
thoughts.

I typically have my services wired together using a DI engine like
ColdSpring or LightWire. So, if UserService, if I need n address, I just
call AddressService.getAddress() and it returns what I need.

I'm not exactly sure what you mean by yObj, but if you're talking about a
trasient business object like a User or Address or Product or Article or
whatever, they won't be composed within a service object as the service
object is a singleton so it ma handle creating, editing or interacting with
objects as part of a given page request, but then it'll usually throw them
away (unless you're creating some kind of caching solution).

Also, I ALWAYS use the service method as my API, so if I want to get a list
of addresses, I call AddressService.getAddresses() which may then happen to
cal AddressGateway.getAddresses(), but that design decision is hidden from
me so I could dump my gateways in favor of DAOs or something else and I'd
only have to refactor within the AddressService - not look for all of the
references to AddressGateway throughout the code.

Hope that helps a little.

Best Wishes,
Peter

On 10/20/07 7:38 AM, "Alan Livie" <[EMAIL PROTECTED]> wrote:

> 
> I have a service CFC that is composed of various other CFC's in the
> same package (directory).
> 
> I have also composed it with CFC's from other packages directly
> (Gateway CFCs for query returns etc)
> 
> My question is:
> 
> Should I compose xService.cfc with yObj.cfc directly or yService.cfc
> (which is composed of a yObj)
> 
> ie should xService get a yObj directly or should it be composed of
> yService and let yService be composed of yObj ?
> 
> I have opted for the simpler solution of just getting the yGateway
> object I need composed in xService. My reason being if yService ends
> up being composed of many other objects I will have all these
> unnecessary objects I don't need in my xService
> 
> Hope this makes sense :-)
> 
> 
> > 




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to