CA013 - Exported creation procedure

Description

If acreation procedure is exported then it may be called by clients after the object has been created. Usually, this is not intended. A client might, for example, by accident call x.make instead of create x.make, possibly causing a class invariant or postcondition to not hold anymore.

Scope class
Status Enabled
Severity Warning
Applicability All
Score 50

Example of violation

class TEST create make feature -- Initialization make -- Initialize Current do end update do end end

Recommendation

Make sure to export the creation procedure to NONE.

In the example, add the export to NONE after the feature clause:class TEST create make feature {NONE} -- Initialization make -- Initialize Current do end feature -- Initialization update do end end

26455914-3b04-cacc-67bb-cd8e083ce947
cached: 02/26/2017 5:12:14.000 PM