Skip to content

Class roles, responsibilities and collaborators

Thomas Volden edited this page Sep 14, 2016 · 9 revisions

We want to keep classes simple and easy to understand. To help with this, we try to think of them as objects and analyze their roles, responsibilities and collaborators. There shouldn't be too many of them.

Client

Extends FeatureHandler
Responsibilities:

  • Handles interaction with 3rd party.

Collaborators:

Server

Extends FeatureHandler
Responsibilities:

  • Handles interaction with 3rd party.

Collaborators:

FeatureHandler

Responsibilities:

  • Maintains list of supported features.

Collaborators: - none -

Listener

Responsibilities:

  • Listens for clients.
  • Creates new sessions.

Collaborators: - none -

Session

Responsibilities:

  • Associates requests with confirmations
  • Handles errors and communicates them to the other end.

Collaborators:

Queue

Responsibilities:

  • Stores/restores requests with unique IDs.

Collaborators: - none -

Communicator

Responsibilities:

  • Transforms Request/Confirmation into protocol formatted data and vice versa.
  • Ensures transaction-relates requests are delivered in order.

Collaborators:

Radio

Responsibilities:

  • Sends data.
  • Receives data.

Collaborators: - none -

Transmitter

Implements Radio
Responsibilities:

  • Establishes a connection to a server.

Collaborators: - none -

Receiver

Implements Radio
Responsibilities:

  • Accepts request from a client.

Collaborators: - none -

Feature

Responsibilities:

  • Describes Request and Confirmation types.
  • Holds action name.
  • Forwards requests to profile.

Collaborators:

Profile

Responsibilities:

  • Has list of required features.
  • Handles callback for incoming Requests.
  • Helps create requests.

Collaborators:

Request

Responsibilities:

  • Holds data for a request.
  • Validates required fields.
  • Validates input for fields.

Collaborators: - none -

Confirmation

Responsibilities:

  • Holds data for a confirmation.
  • Validates required fields.
  • Validates input for fields.

Collaborators: - none -