This is my first post to this list, although I've been reading for awhile and have been using a lot of OO design principles in a site I'm currently building. So forgive me if I'm totally off base.
In my opinion, if you compose yService into xService, just so you can get at yGateway, then you are creating a situation in which yService and yGateway are tightly coupled, which is not a good idea. I would definitely just inject yGateway into xService. One exception to this would be if you've got a method in yService that calls a method in yGateway, and you want to reuse that logic in xService. In that case you'd need to inject yService into xService. Clear as mud? Bob On 10/20/07, 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 -~----------~----~----~----~------~----~------~--~---
