Extending the Slideshow Language-PowerPoint

Extending the Slideshow Language-PowerPoint - CS1102:...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS1102: Extending the Slideshow Language Kathi Fisler, WPI September 17, 2004 1 Introduction: Design by Successive Refinement In the last lecture, we finished implementing a prelimary version of a slideshow program. The language is pretty simple – all we can do is issue commands to display slides in a linear order. Still, we had to develop a lot of infrastructure code to get this much of the system working. We now have a simple interface (which you would have had to develop yourself if you were designing this language), data structures for slides, and the core of a program that can handle slide displays. You’d need all of this to develop the full program anyway, so we’re off to a good start. We are developing our slideshow language through a process known as iterative refinement . We didn’t tackle the entire system at once. Instead, we carved out a small yet cohesive part of the full slideshow program, then designed, implemented and tested it. We finished this implementation before adding more features. This approach is valuable for many reasons: It helps you concentrate on one part of the system. It forces you to understand some of the issues that will affect your entire system design, but without the com- plexity of the whole system. You end up with a collection of working code that you can try to reuse as you add more features to the system. Note that you can’t always reuse your existing code (depending on what features you add later), but you can often reuse a lot of it and you can almost always reuse the insights you developed while working on that code. Basically, iterative refinement encourages you to develop a system in small stages, where each stage builds upon earlier stages. Such early-stage systems are often called prototypes . As you develop languages for this course (and your entire career, for that matter), practice isolating small pieces to implement first and building on those pieces later. With that said, let’s extend the slideshow language! 2 The First Refinement: Timed Conditionals Imagine you are giving a talk using your slideshow package. You’re not really sure how much material to prepare – if your audience asks a lot of questions, you may be running short on time, but you want to have enough material to keep talking in case they don’t ask many questions. Ideally, you’d like your talk program to be conscious of the time and to skip over certain collections of slides depending upon how much time remains. Let’s extend our slideshow package with this functionality. We need to add a timecond construct to our language. This construct is like an if -statement from other languages you’ve studied. It will perform some test on the time that’s elapsed since you started speaking, then choose which set of slides to run next depending on the result of the test. What might this look like in our talk program? Recall that our previous talk program looked like:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/06/2008 for the course CS 1102 taught by Professor Fisler during the Fall '07 term at WPI.

Page1 / 9

Extending the Slideshow Language-PowerPoint - CS1102:...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online