7. Convenience Patterns

Convenience patterns simplify code.

Convenience Method

Purpose: simplify method invocations by reducing number of parameters.

Implementation: define specialized methods that call the general methods, supplying frequently used parameter combinations.

Null Object (Stub)

Purpose: eliminate frequent tests for null references by replacing null references with a reference to the null object.

Implementation: a null object is an instantiation of a class with pseudo implementations of its methods.

Previous group Next group Back to the top