AG VLSI Design and Architecture

SFB 501 - Project D1: Application System "Buildings"

PSiGene

Pattern Catalog

[PSiGene]

5.1 Pattern MethodAlias

Intent

Basic Pattern for creating an alias for a method.

Motivation

Aliases are often used for frequently accessed methods or to map a method expected to exist to an existing method serving the expected functionality.

Applicability

Everytime an expected method has a different name for internal and external use.

Structure

This pattern simply builds a method as interface to the desired method.

Participants

Objects
Methods
Interfaces

Collaborations

Simply calls the bound method.

Consequences

Expected methods can be called without changes in either the object or the external model. Internal accesses still happen by accessing the real method directly while external ones are redirected via the alias.

Methods with parameters may be defined by creating a new Pattern using MethodAlias as SubPattern or by giving the whole parameters with alias and realName . The latter will result in a very powerful way for mapping methods as, for example, the order of parameters may be different.

Implementation

Code-Templates
{alias}
    ^self {realName}

PEdit description

Pattern MethodAlias Category redirection
    ObjectType use target
    SingleMethod implement alias
    SingleMethod use realName
End

previous page next page up   Table of Contents PSiGene