iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
88.57k stars 26.26k forks source link

Acceptor-Connector pattern #231

Open npathai opened 8 years ago

npathai commented 8 years ago

Description: The Acceptor-Connector design pattern decouples connection establishment from connection handling in networked systems. The pattern's main components are the Acceptor, Connector, and Handler. The Acceptor is responsible for listening for incoming connection requests and creating a new connection. The Connector actively initiates connections to a remote service. Once a connection is established, the Handler takes over to manage the communication between peers.

Implementing this pattern will improve the system’s scalability and flexibility by separating connection handling from business logic, allowing each component to be managed and extended independently.

References:

  1. Extension and Java Implementation of the Reactor−Acceptor−Connector Pattern Combination
  2. Sample implementation
  3. Pattern-Oriented Software Architecture Volume 2: Patterns for Concurrent and Networked Objects

Acceptance Criteria:

  1. Implement the Acceptor component to handle incoming connection requests.
  2. Implement the Connector component to initiate outgoing connections.
  3. Implement the Handler component to manage established connections and business logic.
  4. Provide unit tests for each component to ensure proper functionality.
  5. Update documentation with usage examples and detailed descriptions of each component.
iluwatar commented 1 month ago

Updated task description