On 10/20/07, Bob Silverberg <[EMAIL PROTECTED]> wrote:
>
> Oops, my first post and apparently I got it wrong ;-)
>
> So are you guys are saying that you treat gateways as internal components
> of service objects, so that if you need to use a gateway you always access
> it via the service object?


Correct. Nothing outside of yService should even know that yGateway exists
at all. As far as everything outside of yService is concerned, yService is
just one giant black box that does everything itself. In reality, yService
might be using 50 other objects or services to do its work, but all of that
is hidden to the rest of the system.

Encapsulation rules.

So in that case the fact that they're tightly coupled doesn't matter, in
> fact it's preferable.  Thanks for opening my eyes to that.
>
>
Exactly. If you had a system where there was no coupling at all, it would be
a system that couldn't do anything because objects would be aware of
anything outside of themselves. You HAVE to have coupling. The key is to
have the right kind of coupling for the right reasons, and to make sure that
where you do create coupling, you do it as a deliberate design decision.

--~--~---------~--~----~------------~-------~--~----~
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