Methods to implement

 

Overview

Implementing an interface in Java necessitates the redefinition of all its methods.  This detailed task, which can lead to signature copying errors, can be entirely automated.

 

 

Prerequisites

The "Methods to implement" pattern applies to every model class when the class implements an interface.

 

 

Applying the pattern

The model before transformation is as follows:

 

Figure 148. The model before transformation

 

 

Calling the pattern

 

Figure 149. Calling the pattern

 

 

Consequence of applying the pattern

The model after transformation is as follows:

 

Figure 150. The model after transformation

 

 

Summary of modifications made to the model

The class to which the pattern is applied is enriched with further operations, which redefine those of the interfaces which it implements.