Enhancing class commutability in the deployment of design patterns

  • Authors:
  • T. H. Ng;S. C. Cheung

  • Affiliations:
  • Department of Computer Science, Hong Kong University of Science and Technology, Clear Water Bay, Hong Kong, China;Department of Computer Science, Hong Kong University of Science and Technology, Clear Water Bay, Hong Kong, China

  • Venue:
  • Information and Software Technology
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

A design pattern provides a structure to facilitate program changes with respect to a design concern. For example, the State pattern manages object behaviour in different internal states of objects. It allows new internal states of an object to be supported with the reuse of the object context. The deployment of a design pattern in a software program comprises a set of classes following the structure of the pattern. Within the set, classes that implement the managed concern of the pattern are commuted to new ones when changes related to the concern occur. However, commutation efforts can be tedious if these classes are accessed arbitrarily throughout the software. To confine the commutation efforts, these classes should be properly encapsulated. This paper proposes design restrictions in pattern deployments to achieve proper encapsulation. The approach is illustrated by a pattern-based program that supports appointment scheduling of multiple users. Preliminary experiments show that our approach facilitates program changes subject to multiple design concerns.