Catalog of Method Properties

Home - About » Computer Science - Programming - Conventions
Computer Science
Research, Industry Work,
Programming
Community Service
Hillside Group, CHOOSE,
Stanford GSA
The Serious Side
Business School,
Learning Chinese
Humorous Takes
Switzerland, United States,
Software, Fun Photos
Travel Stories
Europe, United States, Asia
  
Living Places
Berlin (+ Gallery), Zürich
Boston, S.F. + Bay Area

(Some of this material has been taken from a Java Report paper.)

We distinguish between the following method properties.

If you want to add method properties to this list, let me know!

Class implementation method properties

Primitive method

Definition: A primitive method is a method that carries out one specific task, usually by directly referring to the fields of the object. It does not rely on any (non-primitive) methods of the class that defines the primitive method.
Also known as: -
JDK example: -
Name example: void AbstractName::assertIsValidIndex(int), String StringName::basicComponent(int).
Prefixes: basic, do.
Comment: Design by Primitive is a key principle of good class design that uses primitive methods.

Composed method

Definition: A composed method is a method that organizes a task into several subtasks that it glues together as a linear succession of method calls. Each subtask is represented by another method, primitive or non-primitive.
Also known as: -
JDK example: -
Name example: String AbstractName::component(int), void AbstractName::component(int, String).
Prefixes: -
Comment: Name taken from [3].

Inheritance interface method properties

Hook method

Definition: A hook method is a method that declares a well-defined task and makes it available for overriding through subclasses.
Also known as: -
JDK example: -
Name example: void AbstractName::basicComponent(int, String).
Prefixes: -
Comment: -

Template method

Definition: A template method is a method that defines an algorithmic skeleton for a task by breaking it into subtasks. Some of the subtasks are deferred to subclasses by means of hook methods.
Also known as: -
JDK example: -
Name example: Name Name::contextName().
Prefixes: -
Comment: Name taken from [4]

Class/instance level method properties

Instance method

Definition: An instance method is a method that applies to an instance of a class.
Also known as: -
JDK example: Every non-static query or mutation method of a class or interface.
Name example: Every non-static query or mutation method of a class or interface.
Prefixes: -
Comment: In reflective systems, an instance method may also be a class method (but need not).

Class method

Definition: A class method is a method that applies to a class.
Also known as: -
JDK example: static String String::valueOf(...), static BigInteger BigInteger::valueOf(long).
Name example: static StringName StringName::newInstance(String name).
Prefixes: -
Comment: In reflective systems, a class method is always an instance method of a class object.

Other method properties

Convenience method

Definition: A convenience method is a method that simplifies the use of another, more complicated method by providing a simpler signature and by using default arguments where the client supplies no arguments.
Also known as: -
JDK example: String BigInteger::toString() (wraps String BigInteger::toString(int radix)).
Name example: String Name::asString(), String Name::asString(char). (But not: asString(char, char).)
Prefixes: -
Comment: Name taken from [5].

Convenience constructor

Definition: A convenience constructor is a constructor that simplifies the use of another, more complicated constructor by providing a simpler signature and by using default arguments where the client supplies no arguments.
Also known as: -
JDK example: BigInteger::BigInteger(String) (wraps BigInteger::BigInteger(String value, int radix)).
Name example: StringName StringName::StringName(String name).
Prefixes: -
Comment: -
Copyright (©) 2007 Dirk Riehle. Some rights reserved. (Creative Commons License BY-NC-SA.) Original Web Location: http://www.riehle.org