Coupling between objects (CBO)

Title short form

CBO

Categories

Maintainability, reusability

Definition

Number of additional function blocks that are instantiated and used in a function block

Further information

CBO = Coupling Between Objects

A function block with a high level of coupling between objects is likely to be involved in many different tasks and therefore violates the principle of clear responsibility.

Standard upper limit for the associated rule SA0179: Coupling between objects

30

Sample:

FUNCTION_BLOCK FB_Base
VAR
    fb3  : FB3;  // +1 instantiated here
END_VAR
FUNCTION_BLOCK FB_Sub EXTENDS FB_Base   // +0 for EXTENDS
VAR
    fb1  : FB1;  // +1: instantiated here
    fb2  : FB2;  // +1: instantiated here
END_VAR
fb3();           // +0: instantiated in FB_Base, no increment for call