Class/Interface Operation Checks

PowerDesigner provides default model checks to verify the validity of class and interface operations.

Check

Description and Correction

Name/Code contains terms not in glossary

[if glossary enabled] Names and codes must contain only approved terms drawn from the glossary.
  • Manual correction - Modify the name or code to contain only glossary terms.
  • Automatic correction - None.

Name/Code contains synonyms of glossary terms

[if glossary enabled] Names and codes must not contain synonyms of glossary terms.
  • Manual correction - Modify the name or code to contain only glossary terms.
  • Automatic correction - Replaces synonyms with their associated glossary terms.

Name/Code uniqueness

Object names must be unique in the namespace.
  • Manual correction - Modify the duplicate name or code.
  • Automatic correction - Appends a number to the duplicate name or code.

Return type assignment

The return type of an operation should be defined.

  • Manual correction: Assign a return type to the operation

  • Automatic correction: Assigns a void return type to the operation

Parameter data type assignment

The data type of a parameter should be defined. Moreover, its type cannot be void.

  • Manual correction: Choose a valid data type for the parameter

  • Automatic correction: None

Abstract operation body

[classes] Abstract operations in a class cannot be implemented.

  • Manual correction: Remove the body or the abstract property of the operation

  • Automatic correction: None

Abstract operation in a instantiable class

[classes] Abstract operations must be declared in abstract classes only.

  • Manual correction: Set the class to abstract, or remove the abstract property of the operation

  • Automatic correction: Removes the abstract property in the operation property sheet

Overloading operations signature

[classes] Overloaded operations with the same name and same parameters data type cannot have different return types in a class.

Overloading an operation refers to using the same method name but performing different operations based on different parameter number or type.

  • Manual correction: Change the operation name, parameter data type, or return type

  • Automatic correction: None

Overriding operations

[classes] When overriding a parent operation in a class, it is impossible to change its modifiers.

Overriding an operation means that an operation defined in a given class is redefined in a child class, in this case the operation of the parent class is said to be overriden.

  • Manual correction: Keep the same modifiers for child operation

  • Automatic correction: None

Enum: Constants must overload abstract method

[classes] You can give each enum constant a different behavior by declaring an abstract method in the enum type and overloading it with a concrete method for each constant. In this case, each constant must overload the abstract method.

  • Manual correction: Make sure each constant is associated with a concrete method that overloads the abstract method.

  • Automatic correction: None