Layer Supertype

  1. Summary

      1. Moves common behavior of several classes in same layer to a single super type to improve reuse.

      2. If you have more than one kind of object in a layer, it's useful to have more than one Layer Supertype.

  2. Example

      1. Generic Getter and Setters implementation

  1. How it works

      1. Layer Supertype[Fowler03]. If the components in the layer share a set of common behaviors, you extract those behaviors into a common class or component from which all the components in the layer inherit.

      2. Not only does this ease maintenance and promote reuse, it also reduces the dependencies between layers by allowing the common behaviors to be invoked through a runtime reference to the supertype instead of a specific component.