Operations, Methods, and Algorithms

It is useful to distinguish operation from method and to then discuss these concepts' relations to algorithm. Fortunately, the UML defines the difference between an operation and method (Booch, Rumbaugh, and Jacobson 1999, p. 128).

  • An operation is a specification of a service that can be requested from an instance of a class.

  • A method is an implementation of an operation.[1]

    [1] For definitions of the related terms abstract method and static method, see the Glossary.

An operation specifies something that a class does and specifies the interface for calling on this service. Multiple classes may implement the same operation in different ways. For example, many classes implement the toString() operation. Every class ...

Get Design Patterns Java™ Workbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.