CS 541 Lecture -*- Outline -*- * the object-oriented paradigm ** What is a paradigm? (in design/programming) recall from the beginning of the year that... ------------------------------------------ THE OBJECT-ORIENTED (OO) PARADIGM A paradigm is: - how to go about design, coding how to approach problems in design how to *organize* programs (style) - a set of tools variables, procedures, loops, ... - a set of questions how to evaluate a design/program? what makes a good/bad program? ------------------------------------------ ** Stepwise refinement (top-down design) *** what it is (ref: Wirth 1971 article in CACM) ------------------------------------------ STEPWISE REFINEMENT (Wirth, 1971) How to approach problems in design: - starts with specification - refines algorithms and data - done when all instructions expressed in programming language How to organize programs: refinement of algorithms: procedures (nesting in Pascal) refinement of data: data structuring primitives (arrays, records in Pascal) ------------------------------------------ example: find abs. mean of a data set refinements in tasks accompanied by refinement in data used to communicate between tasks recurse for each newly identified task draw: refinement tree *** limitations: change each paradigm has limits e.g., hammer analogy not theoretical limits, but practical limits e.g., bicycle without speeds analogy snowshovel vs. snowblower ------------------------------------------ PRACTICAL LIMITATIONS OF STEPWISE REFINEMENT Not designed to handle change: requirements -> specs -> code -> test -> deliver change in requirements ==> redesign ------------------------------------------ stepwise refinement set up to prevent change! spec = contract (signed) after contract is signed customer can't ask for more changes. ** why is change important? ------------------------------------------ CHANGE IS IMPORTANT Because: ------------------------------------------ ... - world is constantly changing - software changes customers expectations, need to keep up to compete So this is the problem that OO solves ** the vision ------------------------------------------ THE VISION OF OO DESIGN METHODS Want software that: - can - has LIMITATIONS/COMPARISON OO | Stepwise refinement =================================== ------------------------------------------ ... evolve easily e.g., find median, find median of data-set of strings, find weighted mean, find mode,... ... reusable components program by putting together building blocks (software ICs) revolution from making it better to work together ... rapid evolution stable requirements flexibility safety speed/memory user interfaces safety critical systems graphics embedded software (cars, toasters) simulation Q: The big question for us is, what are the limits of the OO paradigm? perhaps some of these are solved by AOP...