正在加载图片...
$22.3 GENERAL HEURISTICS FOR FINDING CLASSES 733 [Walden 19951. A class representing a car is no more tangible than one that models the job pages182-183. satisfaction of employees.What counts is how important the concepts are to the enterprise,and what you can do with them. Keep this comment in mind when looking for external classes:they can be quite abstract. SENIORITY_RULE for a parliament voting system and MARKET TENDENCY for a trading system may be just as real as SENATOR and STOCK EXCHANGE.The smile of the Cheshire Cat has as much claim to objectness as the Cheshire Cat. Whether material or abstract,external classes represent the abstractions that specialists of the external world,be they aerospace engineers,accountants or mathematicians,constantly use to think and talk about their domain.There is always a good chance-although not a certainty-that such an object type will yield a useful class,because ty pically the domain experts will have associated significant operations and properties with it. The key word,as usual,is abstraction.Although it is desirable that analysis classes closely match concepts from the problem domain,this is not what makes a candidate class good.The first version of our panel-driven system dramatically showed why:there we had a model directly patterned after some properties of the external system,but terrible from a software engineering viewpoint because the selected properties were low-level and subject to change.A good external class will be based on abstract concepts of the problem domain,characterized (in the ADT way)through external features chosen because of their lasting value. For the object-oriented developer such pre-existing abstractions are precious:they provide some of the system's fundamental classes;and,as we may note once more,the objects are here for the picking Finding the implementation classes Implementation classes describe the structures that software developers use to make their systems run on a computer.Although the fashion in the software engineering literature has been,for the past fifteen years,to downplay the role of implementation,developers know the obvious-that implementation consumes a large part of the effort in building a system,and much of the intelligence that goes into it. The bad news is that implementation is difficult.The good news is that implementation classes,although often hard to build in the absence of good reusable libraries,are not the most difficult to elicit,thanks to the ample body of literature on the topic.Since "Data Structures and Algorithms",sometimes known as"CS 2",is a required component of computing science education,many textbooks survey the rich catalog of useful data structures that have been identified over the years.Better yet,although most existing textbooks do not explicitly use an object-oriented approach,many naturally follow an abstract data type style,even if they do not use the phrase,to present data structures;for example to introduce various forms of table such as binary search trees and hash tables you have first to state the various operations(insert an element with its key, search for an element through its key and so on)with their properties.The transition to classes is fairly straightforward.§22.3 GENERAL HEURISTICS FOR FINDING CLASSES 733 A class representing a car is no more tangible than one that models the job satisfaction of employees. What counts is how important the concepts are to the enterprise, and what you can do with them. Keep this comment in mind when looking for external classes: they can be quite abstract. SENIORITY_RULE for a parliament voting system and MARKET_TENDENCY for a trading system may be just as real as SENATOR and STOCK_EXCHANGE. The smile of the Cheshire Cat has as much claim to objectness as the Cheshire Cat. Whether material or abstract, external classes represent the abstractions that specialists of the external world, be they aerospace engineers, accountants or mathematicians, constantly use to think and talk about their domain. There is always a good chance — although not a certainty — that such an object type will yield a useful class, because typically the domain experts will have associated significant operations and properties with it. The key word, as usual, is abstraction. Although it is desirable that analysis classes closely match concepts from the problem domain, this is not what makes a candidate class good. The first version of our panel-driven system dramatically showed why: there we had a model directly patterned after some properties of the external system, but terrible from a software engineering viewpoint because the selected properties were low-level and subject to change. A good external class will be based on abstract concepts of the problem domain, characterized (in the ADT way) through external features chosen because of their lasting value. For the object-oriented developer such pre-existing abstractions are precious: they provide some of the system’s fundamental classes; and, as we may note once more, the objects are here for the picking. Finding the implementation classes Implementation classes describe the structures that software developers use to make their systems run on a computer. Although the fashion in the software engineering literature has been, for the past fifteen years, to downplay the role of implementation, developers know the obvious — that implementation consumes a large part of the effort in building a system, and much of the intelligence that goes into it. The bad news is that implementation is difficult. The good news is that implementation classes, although often hard to build in the absence of good reusable libraries, are not the most difficult to elicit, thanks to the ample body of literature on the topic. Since “Data Structures and Algorithms”, sometimes known as “CS 2”, is a required component of computing science education, many textbooks survey the rich catalog of useful data structures that have been identified over the years. Better yet, although most existing textbooks do not explicitly use an object-oriented approach, many naturally follow an abstract data type style, even if they do not use the phrase, to present data structures; for example to introduce various forms of table such as binary search trees and hash tables you have first to state the various operations (insert an element with its key, search for an element through its key and so on) with their properties. The transition to classes is fairly straightforward. [Waldén 1995], pages 182-183
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有