Overview;
The Exception Object pattern could also be called the Error or Assertion pattern. Now, it should be known that they all have different meanings, but for our purposes they are all events which we want to dispatch and catch at a later time (or later date when we get around to coding a catch).
Terminology;
An Exception is used to denote a state in the application that is unwanted. That is, the application can no longer procede because an assumption was failed. Exceptions are meant to be caught and handled.
An Error is used to denote a more troubled state within the application. In an Error state, the application can, in theory, no longer to operate successfully and needs to be brought offline or restarted.
An Assertion is a validation check against a variable. That is, a set of parameters comes into your method and you need to assert that they are valid before the method can continue, since the method is expecting them to be such. An Assertion is generally a pre-emptive strick, where as an exception is thrown later during execution of a bad parameter.
0 comments:
Post a Comment