正在加载图片...
734 HOW TO FIND THE CLASSES $22.3 Recently,some textbooks have started to go further by applying a thoroughly object- oriented approach to the traditional CS 2 topics. Whether or not he has gone through a Data Structures and Algorithms Course at school,every software engineer should keep a good textbook on the topic within reach of hand,and go back to it often.It is all too easy to waste time reinventing concepts that are well known,implement a less-than-optimal algorithm,or choose a representation that is not appropriate for the software's use of a data structure-for example a one-way linked list for a sequential structure that the algorithms must regularly traverse back and forth,or an array for a structure that constantly grows and shrinks in unpredictable ways.Note that here too the ADT approach reigns:the data structure and its representation follow from the services offered to clients. Beyond textbooks and experience,the best hope for implementation classes is reusable libraries,as we will see at the end of this chapter. Deferred implementation classes Traditional data structures textbooks naturally emphasize effective(fully implemented) classes.In practice,much of the value ofa set ofimplementation classes,especially if they are meant to be reusable,lies in the underlying taxonomy,as defined by an inheritance structure that will include deferred classes.For example,various queue implementations will be descendants of a deferred class OUEUE describing the abstract concept of sequential list. "Deferred implementation class",then,is not an oxymoron.Classes such as OUEUE,although quite abstract,help build the taxonomies thanks to which we can keep the many varieties of implementation structures coherent and organized,assigning to every class a precise place in the overall scheme. In another book [M 1994a]I have described a "Linnaean"taxonomy of the fundamental structures of computing science,which relies on deferred classes to classify the principal kinds of data structure used in software development. Finding the design classes Design classes represent architectural abstractions that help produce elegant,extendible About iteratorsand software structures.STATE,APPLICATION,COMMAND,HISTORY LIST,iterator MVC see the biblio- classes,"controller"classes as in the Smalltalk MVC model are good examples of design graphical notes. classes.We will see other seminal ideas in subsequent chapters,such as active data structures and "handles"for platform-adaptable portable libraries. Although,as noted,there is no sure way to find design classes,a few guidelines are worth noting: Many design classes have been devised by others before.By reading books and [M1993]. articles that describe precise solutions to design problems,you will gain many fruitful ideas.For example the book Object-Oriented Applications contains chapters written by the lead designers of various industrial projects who describe their734 HOW TO FIND THE CLASSES §22.3 Recently, some textbooks have started to go further by applying a thoroughly object￾oriented approach to the traditional CS 2 topics. Whether or not he has gone through a Data Structures and Algorithms Course at school, every software engineer should keep a good textbook on the topic within reach of hand, and go back to it often. It is all too easy to waste time reinventing concepts that are well known, implement a less-than-optimal algorithm, or choose a representation that is not appropriate for the software’s use of a data structure — for example a one-way linked list for a sequential structure that the algorithms must regularly traverse back and forth, or an array for a structure that constantly grows and shrinks in unpredictable ways. Note that here too the ADT approach reigns: the data structure and its representation follow from the services offered to clients. Beyond textbooks and experience, the best hope for implementation classes is reusable libraries, as we will see at the end of this chapter. Deferred implementation classes Traditional data structures textbooks naturally emphasize effective (fully implemented) classes. In practice, much of the value of a set of implementation classes, especially if they are meant to be reusable, lies in the underlying taxonomy, as defined by an inheritance structure that will include deferred classes. For example, various queue implementations will be descendants of a deferred class QUEUE describing the abstract concept of sequential list. “Deferred implementation class”, then, is not an oxymoron. Classes such as QUEUE, although quite abstract, help build the taxonomies thanks to which we can keep the many varieties of implementation structures coherent and organized, assigning to every class a precise place in the overall scheme. In another book [M 1994a] I have described a “Linnaean” taxonomy of the fundamental structures of computing science, which relies on deferred classes to classify the principal kinds of data structure used in software development. Finding the design classes Design classes represent architectural abstractions that help produce elegant, extendible software structures. STATE, APPLICATION, COMMAND, HISTORY_LIST, iterator classes, “controller” classes as in the Smalltalk MVC model are good examples of design classes. We will see other seminal ideas in subsequent chapters, such as active data structures and “handles” for platform-adaptable portable libraries. Although, as noted, there is no sure way to find design classes, a few guidelines are worth noting: • Many design classes have been devised by others before. By reading books and articles that describe precise solutions to design problems, you will gain many fruitful ideas. For example the book Object-Oriented Applications contains chapters written by the lead designers of various industrial projects who describe their About iterators and MVC see the biblio￾graphical notes. [M 1993]
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有