Pattern 09: Keep Service Operation Signatures Meaningful
Improve the clarity of an operation's purpose by using meaningful parameter types that are derived from domain types.
Relationships
Main Description

Context

To paraphrase the Rational Unified Process, an operation:

...represents a capability that can be requested from an object to effect behavior. An operation specifies the name, type, parameters, and constraints for invoking an associated behavior.

Problem

It is difficult to understand what an operation does if its signature is not meaningful.

Forces

  • Modeling an operation signature using a single input and output message reduces the amount of meaning of that signature.
  • Often on diagrams, only the signature of an operation might be shown without the structure of the types used in the signature.

Solution

Keep operations as meaningful as possible:

  • Avoid modeling your operation using a simple request/response message pair.
  • Use meaningful parameter types derived from your domain types to type your parameters.
  • Name parameters helpfully (for example, newCustomer:Customer for the createCustomer operation).

Rationale

Meaningful operation signatures enable you to convey more meaning in diagrams that only show service specifications without showing the structure of the parameters.

More Information