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

From OOModels
< Artefact:Model‎ | com‎ | sphenon‎ | basics‎ | exception
Revision as of 09:51, 26 March 2010 by AndreasLeue (talk | contribs) (New page: {{Metabox | Meta_Type = Type:org/oomodels/WIML/1.0 | Meta_Domain = Domain:it/test | Meta_Category = Type:org/oomodels/wiki/Model | Meta_Downloa...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Classification
Type Type:org/oomodels/WIML/1.0
Domain Domain:it/test
Category Type:org/oomodels/wiki/Model
More
Download Code
Diagram
Namespace (more)
create new pages

Code[edit]

ExceptionPreConditionViolation
ExceptionProtocolViolation


Description[edit]

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.