Artefact:Model/com/sphenon/basics/exception/ExceptionProtocolViolation

From OOModels

Jump to: navigation, search
Classification
Type Type:org/oomodels/WIML/1.0
Domain Domain:it/test
Category Type:org/oomodels/wiki/Model
More
Download Code (dev)
Diagram
Namespace (more)
create new pages

Code

ExceptionPreConditionViolation
ExceptionProtocolViolation


Description

The object protocol was violated. I.e., a method was called while the object was not in a respective required state.

A typical reason is: objects that are — temporarily, during construction — allowed to exist in an invalid state and are being used in that state.

It is not always clear who is responsible for the mistake, strictly speaking it is a precondition violation ("do not call methods on invalid objects"), but probably the caller has no means and is not responsible to determine the validity. E.g. the object might be "living" and becomes suddenly invalid. Then, the caller itself cannot do anything else but what the callee does, namely checking validity and throwing some rather meaningless exception.