Operations can be
public or private. Private operations
are used by an object for its own internal affairs and are not part
of the interface of the object. Public operations are services that
the object exposes for consumption by other objects. These operations
comprise the contract of the object and remain stable throughout the
lifecycle of the system to avoid ripple effects throughout the system.
Changes to private operations (and attributes) do not impact the rest
of the system.
Declarations
and definitions for public
and private operations can be generated in either the specification
or implementation file for an object, depending on the visibility
of the operation.
Note: Events and triggered operations
are always public.
Operation names have different
default formats,
depending on whether the operation is public or private:
- Public operation names have the format <object>_<opname>().
- Private operation names have the format <opname>().
You can change the default format of operation
names
using the following properties:
- The C_CG::Operation::PublicName property
specifies the pattern used to generate names of public operations
in C.
- The C_CG::Operation::ProtectedName property
specifies the pattern used to generate names of private operations
in C.