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. 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.
The language should make it possible to equip a class and its features with assertions relying on tools to produce documentation out of these assertions and optionally, monitor them at run time.The features of an abstract data type have formally specified properties, which should be reflected in the corresponding classes. Assertions routine preconditions, routine postconditions and class invariants play this role.
Assertions describe the effect of features on objects, independently of how the features have been implemented.They help produce reliable software and provide systematic documentation and they are a central tool for testing and debugging object oriented software.In the society of software modules with classes serving as the cities and instructions serving as the executive branch of government, assertions provide the legislative branch. We shall see below who takes care of the judicial system.
No comments:
Post a Comment