Model review and simulation > Reviewer > Provided PTC reviews > Style reviews > Unnecessary use of public access (Reviewer Review)
Unnecessary use of public access (Reviewer Review)
Each operation with public access is checked against sequence diagram messages to see if the operation is called by any class other than itself or subclasses of itself. If no other classes can be found then the operation access could be made protected (or private).
Consequences
Making an operation public that should only be used by the class itself means that users of the class might mistakenly call the operation.
Keeping a class' interface smaller makes the class easier to understand. Unnecessarily exposing operations publicly may add confusion.
Strategy
If the operation should be public for future use and the model's object sequence diagrams do not show any current use, then you should ignore the review item giving the reason why the operation should be kept public.
If the operation is only going to be used internally then it should be made protected, unless no subclasses should call the operation, in which case it should be marked as private.