This preview shows page 1. Sign up to view the full content.
Unformatted text preview: nformation exchange between clients and servers in a dynamic environment Solution structure Define six kinds of objects: Clients - Run user applications; communicate users requests to servers through client proxies Client proxies - Pack data sent by client; unpack data sent by server; communicate with brokers regarding requests and responses
124 Broker pattern
Solution structure (cont d) Additional kinds of objects: Pattern Structure of Broker pattern
ClientProxy! packData()! sendRequest()! return()! Pattern
Broker! mainEventLoop()! updateRepository()! registerService()! acknowledge()! findServer()! findClient()! forwardRequest()! forwardResponse()! Broker - Registers servers; provides API (Application Programming Interface); transfer messages; collaborate with other brokers (maybe through bridges); locates servers Server proxies - Call services provided by server; unpack data sent by client; pack data sent by server; communicate with brokers regarding requests and responses Bridges - Mediate between heterogeneous proxies Servers - Implement services; provide protocol for requesting services; register with brokers; provide answers to requests through server proxies
125 Client! callServer()! startTask()! useBrokerAPI()! ServerProxy! packData()! callService()! sendResponse()! Server! initialize()! registerService()! runService()! enterMainLoop()! useBrokerAPI()! 126 Pattern Pattern Broker pattern (cont d) Broker pattern (cont d) Implementation issues 1. Definition of object model What kind of object interfaces, supported types, operations, exceptions, etc.? Alternatively, use lookup table (hashing?) 2. Define component interoperability Binary standard (e.g., MS OLE) Interface Definition Language (IDL) File containing textual description of services offered by server to clients
127 Implementation issues (cont d) 3. Definition of Application Programming Interface (API) offered by brokers for benefit of clients and servers 4. Definition of Broker components Related pattern Client-Dispatch-Service: Just sets up initial link between client and server -- Further communication handled directly between client and server
128 Pattern Conclusions Broker pattern
See also (cont d) So, what good are patterns? Many advertised advantages, most notably: Document well-tried design experience Do not re-invent whe...
View Full Document
This note was uploaded on 02/23/2012 for the course COMP 553 taught by Professor Ajay during the Spring '12 term at Ill. Chicago.
- Spring '12