正在加载图片...
$29.4 TOWARDS A NEW SOFTWARE PEDAGOGY 943 applications.One can only get so much excitement out of computing the first 25 Fibonacci numbers,or replacing all occurrences of a word by another in a text,two typical exercises of elementary programming courses. With the object-oriented method,a good O-O environment and,most importantly, good libraries,a different strategy is possible if you give students access to the libraries early in the process.In this capacity students are just reuse consumers,and use the library components as black boxes in the sense defined above;this assumes that proper techniques are available for describing component usage without showing the components'internals.Then students can start building meaningful applications early: their task is merely to combine existing components and assemble them into systems.In many respects this is a better introduction to the challenges and rewards of software development than the toy examples which have been the mainstay of most introductory courses Almost on day one of the course,the students will be able to produce impressive applications by reusing existing software.Their first assignment may involve writing just a few lines-enough to call a pre-built application,and yielding striking results (devised by someone else!).It is desirable,by the way,to use libraries that include graphics or other multimedia components,so as to make the outcome truly dazzling Later,students will be invited to go further.First they will be shown,little by little, the internals of some of the components.Then they will be asked to make some extensions and modifications,either in the classes themselves or in new descendants.Finally they will write their own classes(the step that would have come first in a traditional curriculum, but should not occur until they have had ample exposure to the work of their elders). This leaming process may be called "progressive opening of the black boxes"or, using a shorter name,the consumer-to-producer strategy.("Outside-in"would also be an appropriate name.) Consumer-to-producer strategy S1.Learn to use library classes,solely through their abstract specifications. S2.Learn to understand the internals of selected classes. S3.Learn to extend selected classes. S4 Learn to modify selected classes. S5.Learn to add your own classes. If you like automotive comparisons,think of someone who first learns to drive,then is invited to lift the hood and study,little by little,how the engine works,then will do repairs -and,much later,design his own cars. For this process to work,good abstraction facilities must be present,allowing a consumer to understand the essentials of a component without understanding all of it.The notion of short form of a class supports this idea by listing the exported features with their assertions,but hiding implementation properties.After students have seen and understood§29.4 TOWARDS A NEW SOFTWARE PEDAGOGY 943 applications. One can only get so much excitement out of computing the first 25 Fibonacci numbers, or replacing all occurrences of a word by another in a text, two typical exercises of elementary programming courses. With the object-oriented method, a good O-O environment and, most importantly, good libraries, a different strategy is possible if you give students access to the libraries early in the process. In this capacity students are just reuse consumers, and use the library components as black boxes in the sense defined above; this assumes that proper techniques are available for describing component usage without showing the components’ internals. Then students can start building meaningful applications early: their task is merely to combine existing components and assemble them into systems. In many respects this is a better introduction to the challenges and rewards of software development than the toy examples which have been the mainstay of most introductory courses. Almost on day one of the course, the students will be able to produce impressive applications by reusing existing software. Their first assignment may involve writing just a few lines — enough to call a pre-built application, and yielding striking results (devised by someone else!). It is desirable, by the way, to use libraries that include graphics or other multimedia components, so as to make the outcome truly dazzling. Later, students will be invited to go further. First they will be shown, little by little, the internals of some of the components. Then they will be asked to make some extensions and modifications, either in the classes themselves or in new descendants. Finally they will write their own classes (the step that would have come first in a traditional curriculum, but should not occur until they have had ample exposure to the work of their elders). This learning process may be called “progressive opening of the black boxes” or, using a shorter name, the consumer-to-producer strategy. (“Outside-in” would also be an appropriate name.) If you like automotive comparisons, think of someone who first learns to drive, then is invited to lift the hood and study, little by little, how the engine works, then will do repairs — and, much later, design his own cars. For this process to work, good abstraction facilities must be present, allowing a consumer to understand the essentials of a component without understanding all of it. The notion of short form of a class supports this idea by listing the exported features with their assertions, but hiding implementation properties. After students have seen and understood Consumer-to-producer strategy S1 • Learn to use library classes, solely through their abstract specifications. S2 • Learn to understand the internals of selected classes. S3 • Learn to extend selected classes. S4 • Learn to modify selected classes. S5 • Learn to add your own classes
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有