3 - CMPSCI 187: Programming With Data Structures Lecture 3:...

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

View Full Document Right Arrow Icon
CMPSCI 187: Programming With Data Structures Lecture 3: Software Engineering Overview 12 September 2011
Background image of page 1

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

View Full DocumentRight Arrow Icon
Software Engineering Overview • Leftover from Lecture 2: dog example, methods, the call stack, exceptions • Software versus Programs • Software Engineering versus Engineering • Eight Goals of Software Quality
Background image of page 2
Dynamic Typing Example public class Dog { public void bark { System.out.println(“Woof!”);}} public class Terrier extends Dog { public void bark { System.out.println(“Yip!”);} public void dig {}} Dog cardie = new Dog(); Dog duncan = new Terrier(); cardie.bark(); // Woof! duncan.bark(); // Yip! cardie.dig(); // won’t compile duncan.dig(); // won’t compile Terrier d = (Terrier) duncan; d.dig(); // works d.bark(); // Yip! Terrier c = (Terrier) cardie; // compiles, ClassCastException
Background image of page 3

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

View Full DocumentRight Arrow Icon
• When one method calls another, the context of the Frst is saved to return to. • If that second method calls a third, both must be saved. When we restore context, we return to the one that was saved last. • When we save a bunch of things and only want to access the last-saved one Frst, we need a stack . • An exception interrupts a method. If the exception can be thrown, it goes to the calling method, where it might stop execution or be thrown to the method calling that, and so on. • The operating system prints the call stack when an exception stops execution -- which methods were in progress when the exception happened. The Call Stack and Exceptions
Background image of page 4
Back to Software Engineering • What is software ? How is it different from CMPSCI 121 or 187 programs? • Wikipedia (this week): “Software is a conceptual entity which is a set of computer programs, procedures, and associated documentation concerned with the operation of a data processing system.” • A single program solves a single data processing problem, with speciFed input and output. The programs in a piece of software may have different users, different desired behaviors, different versions, etc. • Note “procedures”, “associated documentation” -- everything in the system
Background image of page 5

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

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

This note was uploaded on 11/22/2011 for the course COMPSCI 187 taught by Professor Barrington during the Fall '11 term at UMass (Amherst).

Page1 / 15

3 - CMPSCI 187: Programming With Data Structures Lecture 3:...

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

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