正在加载图片...
$2.2 METHOD AND LANGUAGE 23 The result is a seamless development process,where the generality of the concepts and notations helps reduce the magnitude of the transitions between successive steps in the lifecycle. These requirements exclude two cases,still frequently encountered but equally unsatisfactory: The use of object-oriented concepts for analysis and design only,with a method and notation that cannot be used to write executable software. The use of an object-oriented programming language which is not suitable for analysis and design. In summary: An object-oriented language and environment,together with the supporting method,should apply to the entire lifecycle,in a way that minimizes the gaps between successive activities. Classes The object-oriented method is based on the notion of class.Informally,a class is a software element describing an abstract data type and its partial or total implementation. An abstract data type is a set of objects defined by the list of operations,or features, applicable to these objects,and the properties of these operations. The method and the language should have the notion of class as their central concept. Assertions 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.They describe the effect of features on objects,independently of how the features have been implemented Assertions have three major applications:they help produce reliable software;they provide systematic documentation;and they are a central tool for testing and debugging object-oriented software. The language should make it possible to equip a class and its features with assertions(preconditions,postconditions and invariants),relying on tools to produce documentation out of these assertions and,optionally,monitor them at run time. In the society of software modules,with classes serving as the cities and instructions (the actual executable code)serving as the executive branch of government,assertions provide the legislative branch.We shall see below who takes care of the judicial system.§2.2 METHOD AND LANGUAGE 23 The result is a seamless development process, where the generality of the concepts and notations helps reduce the magnitude of the transitions between successive steps in the lifecycle. These requirements exclude two cases, still frequently encountered but equally unsatisfactory: • The use of object-oriented concepts for analysis and design only, with a method and notation that cannot be used to write executable software. • The use of an object-oriented programming language which is not suitable for analysis and design. In summary: Classes The object-oriented method is based on the notion of class. Informally, a class is a software element describing an abstract data type and its partial or total implementation. An abstract data type is a set of objects defined by the list of operations, or features, applicable to these objects, and the properties of these operations. Assertions 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. They describe the effect of features on objects, independently of how the features have been implemented. Assertions have three major applications: they help produce reliable software; they 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 (the actual executable code) serving as the executive branch of government, assertions provide the legislative branch. We shall see below who takes care of the judicial system. An object-oriented language and environment, together with the supporting method, should apply to the entire lifecycle, in a way that minimizes the gaps between successive activities. The method and the language should have the notion of class as their central concept. The language should make it possible to equip a class and its features with assertions (preconditions, postconditions and invariants), relying on tools to produce documentation out of these assertions and, optionally, monitor them at run time
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有