I'm working on my upcoming session for the Columbus Day of .NET and as I'm listing some of my talking points, a question occurred to me: what's the difference between a Service Agent and a Service Gateway? I've kind of always used them interchangeably, but since I'm giving a talk about one of them (the Service Gateway) I figured I best do a little research into the matter. Afterall, someone at the session is bound to ask me what the difference is, and I better have at least some sort of semi-intelligent answer.
So I pulled out two of the Patterns and Practices books: “Enterprise Solution Patterns in .NET” and “Application Architecture for .NET: Designing Applications and Services”. These two books have been tremendously helpful to me over the course of time, and if you haven't read them, I strongly suggest you do (the sooner the better, trust me).
In the Application Architecture book, the term Service Agent is used, with the following definition:
”When a business component needs to use functionality provided in an external service, you may need to provide some code to manage the semantics of communicating with the particular service. Service agents isolate the idiosynchrasies of calling diverse services from your application, and can provide additional services, such as basic mapping between the format of the data exposed by the service and the format your application requires.”
In the Enterprise Solution Patterns book, the term Service Gateway is used, with the following definition:
”The Service Gateway design pattern provides guidance for implementing the service consumer portion of the contract. It discusses using a component that encapsulates all the low-level details of communicating with the service and exposes an interface that is optimized for the use of the other components within the service consumer application. Service Gateway also maps between the internal organization of information in your application and the format mandated by the service's communication contract.”
Essentially, both of those definitions say the same thing, which means there isn't really any difference between the two. And although there are hints that a Service Agent is a physical representation of the Service Gateway pattern itself, it's fairly obvious the two terms are synonomous and interchangeable.
Print | posted on Monday, January 10, 2005 9:41 PM