Thursday, June 25, 2009

Exception handling

                             Abnormal events may occur during the execution of a software system. In object oriented computation, they often correspond to calls that cannot be executed properly, as a result of a hardware malfunction, of an unexpected impossibility or of a bug in the software.To produce reliable software, it is necessary to have the ability to recover from such situations. This is the purpose of an exception mechanism.

                             In the society of software systems, as you may have guessed, the exception mechanism is the third branch of government, the judicial system When the execution of a software system causes the call of a certain feature on a certain object.To provide such a guarantee of correct execution, the language must be typed. This means that it enforces a few compatibility rules; in particular. Feature call should be the primary computational mechanism. 

                         Every entity is explicitly declared as being of a certain type, derived from a class. Every feature call on a certain entity uses a feature from the corresponding class. Assignment and argument passing are subject to conformance rules, based on inheritance, which require the source’s type to be compatible with the target’s type.The language should provide a mechanism to recover from unexpected abnormal situations.

                          In a language that imposes such a policy, it is possible to write a static type checker which will accept or reject software systems, guaranteeing that the systems it accepts will not cause any “feature not available on object” error at run time.A well-defined type system should, by enforcing a number of type declaration and compatibility rules, guarantee the run-time type safety of the systems it accepts.

No comments:

Post a Comment