Context
Used when components developed in different programming languages, which with low interoperability between each other, have to communicate and collaborate together.
Solution
Use a common infrastructure as a language-independent third party media, and develop a common protocol as communication standard.
The ProtocolAdapter is responsible for maintaining the Protocol, translating language-specific message into message under Protocol, and vice versa.

Example
An example using socket and TCP/IP network is illustrated bellow.

Consequences
- Increase the reuse of components implemented in different programming languages.
- The language-independent third party media usually contributes to constraints on usage of the applied application. Usability may be somewhat sacrificed.
- There will definitely be performance issues.
- Mediator Pattern
- Adapter Pattern
沒有留言:
張貼留言